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
Turns out 4 + 4 + 2 + (4 * 2) is actually 18 and not 22. This avoids
a presumably unintentional padding of uninitialised bytes at the end
of the CONT tags chunk, which should be harmless but causes warnings
in valgrind (see #608533 for a test URL).
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.
The correct basis for (Xing, VBRI) seek table calculations is the
byte size and duration provided by that metadata, rather than some
other (possibly even estimated) one. This also prevents an infinite
conversion loop in (unlikely) case where a TOC is provided without
such corresponding (duration) metdata.
Use the same strategy as accurate seeks to store
pending non-accurate seeks to avoid overwriting non-definite
stop times. When doing non-accurate seeks our position
reporting might drift off by some secs and the stream can
end up before it should.
Fixes#603695
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
Fixes#598761
This removes a good 50% of processing time for parsing a buffer.
We do this by simply... getting the nicks that we already have handy
instead of going through the expensive glib system.
Previously, we could get false sync relatively easily - it sometimes happened
on real files. This cleans the code up a fair bit, and makes it require more
confirmation that we've found valid sync before continuing.
Metadata provided seek tables are consistent with metadata's view of
total size, which typically matches real size, but need not do so
(e.g. a truncated file). Fixes seeking and position reporting
in such truncated files (although duration based on metadata may then
still be incorrect).
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