lib/xiph/OggFind: add parameter "synced"
This commit is contained in:
parent
54d57fdcc2
commit
881d91f86b
@ -57,13 +57,14 @@ OggSeekPageAtOffset(OggSyncState &oy, ogg_stream_state &os, InputStream &is,
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
OggSeekFindEOS(OggSyncState &oy, ogg_stream_state &os, ogg_packet &packet,
|
OggSeekFindEOS(OggSyncState &oy, ogg_stream_state &os, ogg_packet &packet,
|
||||||
InputStream &is)
|
InputStream &is, bool synced)
|
||||||
{
|
{
|
||||||
if (!is.KnownSize())
|
if (!is.KnownSize())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (is.GetRest() < 65536)
|
if (is.GetRest() < 65536)
|
||||||
return OggFindEOS(oy, os, packet);
|
return (synced || oy.ExpectPageSeekIn(os)) &&
|
||||||
|
OggFindEOS(oy, os, packet);
|
||||||
|
|
||||||
if (!is.CheapSeeking())
|
if (!is.CheapSeeking())
|
||||||
return false;
|
return false;
|
||||||
|
@ -47,10 +47,13 @@ OggSeekPageAtOffset(OggSyncState &oy, ogg_stream_state &os, InputStream &is,
|
|||||||
* Try to find the end-of-stream (EOS) packet. Seek to the end of the
|
* Try to find the end-of-stream (EOS) packet. Seek to the end of the
|
||||||
* file if necessary.
|
* file if necessary.
|
||||||
*
|
*
|
||||||
|
* @param synced is the #OggSyncState currently synced? If not, then
|
||||||
|
* we need to use ogg_sync_pageseek() instead of ogg_sync_pageout(),
|
||||||
|
* which is more expensive
|
||||||
* @return true if the EOS packet was found
|
* @return true if the EOS packet was found
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
OggSeekFindEOS(OggSyncState &oy, ogg_stream_state &os, ogg_packet &packet,
|
OggSeekFindEOS(OggSyncState &oy, ogg_stream_state &os, ogg_packet &packet,
|
||||||
InputStream &is);
|
InputStream &is, bool synced=true);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user