Commit 943a67c8 authored by Max Kellermann's avatar Max Kellermann

decoder/ogg: need to sync small files while looking for EOS

When calling OggSeekFindEOS() from inside a OggVisitor callback, then the #InputStream may be in the middle of an Ogg packet, and the newly initialized #ogg_sync_state will not be able to load it without the help of ogg_sync_pageseek(). By passing "synced=false" to OggSeekFindEOS(), we force the use of ogg_sync_pageseek() even when not actually seeking. Closes https://github.com/MusicPlayerDaemon/MPD/issues/719
parent 881d91f8
...@@ -47,8 +47,12 @@ OggDecoder::LoadEndPacket(ogg_packet &packet) const ...@@ -47,8 +47,12 @@ OggDecoder::LoadEndPacket(ogg_packet &packet) const
DecoderReader reader(client, input_stream); DecoderReader reader(client, input_stream);
OggSyncState sync2(reader); OggSyncState sync2(reader);
OggStreamState stream2(GetSerialNo()); OggStreamState stream2(GetSerialNo());
/* passing synced=false because we're inside an
OggVisitor callback, and our InputStream may be in
the middle of an Ogg packet */
result = OggSeekFindEOS(sync2, stream2, packet, result = OggSeekFindEOS(sync2, stream2, packet,
input_stream); input_stream, false);
} }
/* restore the previous file position */ /* restore the previous file position */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment