You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One possible solution for RustAudio/lewton#84 requires to look ahead future packets. This issue is for discussing the API and internal design.
My idea is as follows:
Add a function like this: PacketReader::peeking_reader<'a>(&'a mut self) -> PeekingPacketReader<'a>
This way, we cannot use the original PacketReader while using PeekingPacketReader.
PeekingPacketReader provides subset functions of those of PacketReader: into_inner, read_packet and read_packet_expected. (and possibly delete_unread_packets?)
When a PeekingPacketReader is generated, it stores the current position of underlying reader, which will be restored when the PeekingPacketReader is dropped.
Alternatively, we can store all the loaded packets into PacketReader and yield them first after the Peeking one is invalidated. This way, we don't have to rely on base reader's Seekableness.
How do you think?
The text was updated successfully, but these errors were encountered:
One possible solution for RustAudio/lewton#84 requires to look ahead future packets. This issue is for discussing the API and internal design.
My idea is as follows:
PacketReader::peeking_reader<'a>(&'a mut self) -> PeekingPacketReader<'a>
This way, we cannot use the original
PacketReader
while usingPeekingPacketReader
.PeekingPacketReader
provides subset functions of those ofPacketReader
:into_inner
,read_packet
andread_packet_expected
. (and possiblydelete_unread_packets
?)PeekingPacketReader
is generated, it stores the current position of underlying reader, which will be restored when thePeekingPacketReader
is dropped.PacketReader
and yield them first after the Peeking one is invalidated. This way, we don't have to rely on base reader'sSeek
ableness.How do you think?
The text was updated successfully, but these errors were encountered: