We update the passed begintime argument to narrow our search region in the
binary search. This means that it does not always contain the chain begin time
after a couple of bisects. Use the real chain->begin_time to bring the
granuletime to the time in the chain instead.
Fixes#610005
This can happen if the combined flow return is not OK although the
allocation succeeded or if the packet in question is a BOS and we're
not going to push headers.
Fixes bug #608699.
Use _ogg_packet_free() instead of gst_mini_object_unref in one more
place now that the header list contains ogg packets and not buffers.
file: Stephen_Fry-Happy_Birthday_GNU-nq_600px_425kbit.ogv
Last stop is already based on the chain start and there is no need
to subtract the chain start as it may lead to a negative overflow.
This was causing seeking issues when the target chain was not
the first one (that has chain start = 0)
Fixes#606382
When performing seeks, the granulepos should be offset by
its chain start time to avoid using wrong values to
update segment's last_stop. A sample file is indicated on
bug #606382
Keep a list of headers for each stream of a chain. When a chain is activated,
push the headers before pushing the data so that decoders can sync.
Fix seeking in chains, take the chain start time into account when comparing
timestamps.
See #606382
Implement keyframe seeking in oggdemux by doing the double seek trick. First
seek to the required position, then read pages for all streams to grab the
granulepos (to know the timing of the keyframe) of each stream, then seek back
to the first keyframe.
After a seek, discard all packets before the packet with the granulepos on it so
that the output buffers contain valid timestamps.
Reorder some code so that we check the timestamps before allocating and pushing
an output buffer.
Do more checks on valid packets in ogm mode.
OGM demuxing no longer requires helper elements. It's done internally
in oggdemux. Vorbis comments are still not handled because I don't
have anything to test with.
gstoggstream.c:419: error: format ‘%lld’ expects type ‘long long int’, but argument 8 has type ‘gint64’
gstoggdemux.c:2253: error: format ‘%lld’ expects type ‘long long int’, but argument 8 has type ‘GstClockTime’
gstoggdemux.c:2333: error: format ‘%lld’ expects type ‘long long int’, but argument 8 has type ‘GstClockTime’
Timestamp generation was broken by the last commit for formats
with a non-zero granule shift. Also keep track of the last keyframe
so that we can regenerate granulepos for theora.
Add a granule to granulepos conversion function. Fix the duration
function for vorbis. Handle timestamps on header packets differently
and be more careful about calculating OFFSET and OFFSET_END. After
this change, timestamps for vorbis don't exactly match up with the
timestamps that vorbisparse outputs, but it's unclear if vorbisparse
is actually correct and it would add a lot more code to make oggdemux
match vorbisparse. Fixes#602790.
Adds code that parses headers of various formats encapsulated in
Ogg in order to calculate timestamps and durations of each buffer.
Removes the creation of helper decoder elements to do this calculation
via conversion queries.
Fixes: #344013, #568014.