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
This commit is contained in:
Max Kellermann 2020-01-25 20:04:22 +01:00
parent 881d91f86b
commit 943a67c805

View File

@ -47,8 +47,12 @@ OggDecoder::LoadEndPacket(ogg_packet &packet) const
DecoderReader reader(client, input_stream);
OggSyncState sync2(reader);
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,
input_stream);
input_stream, false);
}
/* restore the previous file position */