Quite a few (broken?) files have a packet duration of 1ms, which is
most definitely wrong for either audio or video packets.
We therefore avoid using that value and instead use other metrics to
determine the buffer duration (like using the extended stream properties
average frame duration if present and valid).
Only error out when downstream returns:
* NOT_SUPPORTED
* ERROR
* NOT_NEGOTIATED
* NOT_LINKED
If we got _UNEXPECTED, we push an EOS downstream (since maybe only one
of the streams had gone EOS) and then stop the task silently.
In the case of WRONG_STATE we just need to stop silently
https://bugzilla.gnome.org/show_bug.cgi?id=600412
When on push mode and receiving an EOS event, asfdemux
should push all pending data because we might be dealing
with a broken file that has a preroll value higher
than its actual length.
Some (broken) streams don't have the extended stream properties in
the header, resulting in applying a duration of zero on outgoing
buffers.
Fixes#611473
Some files have payload with timestamps smaller than the preroll duration.
Instead of blindly substracting the preroll value (and ending up with
insanely high timestamps on the outgoing buffers), we make sure we
never go below 0.
Fixes#610432
We previously only aggregated flow returns after the while(push) loop,
which meant that in some cases we would end-up not properly aggregating
the flow returns.
This is based on the same flow aggregation algorithm as oggdemux.
Adds chained asfs handling to pull mode. It now checks if
there is a new asf header after the last packet (when it
is possible to know how many packets are) or it tries
checking if a processed packet that fails is an header
object.
Fixes#599718
Adds support for detecting and playing chained asfs
in push mode. asfdemux tries to detect a new asf start
by identifying the header object guid in a input buffer.
When it finds it, it resets its state, removing its pads
and creates new ones for the new file.
When receiving bogus data, we have to avoid subtracting a value
larger than 'size' from 'size' variable, resulting in a wrap
that would make 'size' a really large bogus value.
Fixes#599333
asf packets in rtp packets should come with their padding fields
set to 0 and the depayload must update them to the correct
value before pushing downstream
This also fixes a bug by which the first buffer (in a multi-packet mode)
passed to asf_demux_parse_packet() would have a GST_BUFFER_SIZE of the
full incoming buffer and not just of the single asf packet.
Fixes corrupted frames introduced by latest commit.
We now have a chance for packets to be collected before we send out the
newsegment. If we're not in accurate seeking (keyunit) it will set
the segment start/time to the keyframe's timestamp.
We now *always* seek to the keyframe just before our requested position.
When we encounter the first keyframe and we were not accurate (therefore doing
keyframe seeking), we update the segment start position to the keyframe timestamp.
This will still cause some timestamp jitter, but giving a hint as to the duration
rather than nothing seems to be a better idea.
Also, this allows some scenarios (like remuxing with asfmux) to estimate the total
duration using the accumulated packet duration (which will be correct).