Also parse segment durations as floating point, which is allowed
since HLS version 3.
This is based on a patch by Zhang Rui.
Signed-off-by: Martin Storsjö <martin@martin.st>
When first_timestamp was stored as-is, its actual time base
wasn't known later in the seek function.
Additionally, the logic (from 795d9594cf) for scaling it
based on stream_index is flawed - stream_index in the seek
function only specifies which stream the seek timestamp refers
to, but obviously doesn't say anything about which stream
first_timestamp belongs to.
In the cases where stream_index was >= 0 and all streams had the
same time base, this didn't matter in practice.
Seeking taking first_timestamp into account is problematic
when one variant is mpegts (with real timestamps) and one variant
is raw ADTS (with timestamps only being accumulated packet
duration), where the variants start at totally different timestamps.
Signed-off-by: Martin Storsjö <martin@martin.st>
Compilation with --disable-everything --enable-shared failed
on systems with VAAPI support with the following undefined
symbol in libavcodec/vaapi.o:
libavcodec/libavcodec.so: undefined reference to `ff_mpeg_draw_horiz_band'
This reverts commit 4b6869d6e0.
Conflicts:
libavcodec/bitstream.c
This code can cause assertion failures on artificial OOM situations
It will be replaced by a solution that doesnt have this issue in the
following commits.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* qatar/master:
hls: Create an AVProgram for each variant
Conflicts:
libavformat/hls.c
See: 23db5418ed
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '9d64f236292ba28018dd9afd2d57f8f944b33f81':
hls: Respect the different stream time bases when comparing dts
Conflicts:
libavformat/hls.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'c11e33a3d9665dd1fc5dbdecdd03a4860ac6a622':
hls: Set stream offset before opening a chained demuxer
Conflicts:
libavformat/hls.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'cdd2d73d315ecaf19ff49e64c91923275f1bda68':
hls: Don't check discard flags until the parent demuxer's streams actually exist
hls: Copy the time base from the chained demuxer
Conflicts:
libavformat/hls.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'eb33ba04e03d9f36e23fffd442510c824be709c3':
hls: Return all packets from a previous variant before moving on to the next one
Conflicts:
libavformat/hls.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '3ca1dd2502a860989ee5289316af6b9816cee78f':
xl: Make sure the width is valid
Conflicts:
libavcodec/xl.c
See: 94b42da696
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Without the information, an application may choose audio from one
variant and video from another variant, which leads to fetching two
variants from the network. This enables av_find_best_stream() to find
matching audio and video streams, so that only one variant is fetched.
Signed-off-by: Martin Storsjö <martin@martin.st>
Also adjust the streams timestamps according to their start
timestamp when comparing. This helps getting correctly interleaved
packets if one stream lacks timestamps (such as a plain ADTS
stream when the other variants are full mpegts) when the others
have timestamps that don't start from zero.
This probably doesn't work properly if such a stream is
temporarily disabled (via the discard flags) and then reenabled,
and such streams are hard to correctly sync against the other
streams as well - but this works better than before at least.
The segment number restriction makes sure all variants advance
roughly at the same pace as well.
Signed-off-by: Martin Storsjö <martin@martin.st>
If passing the end of one segment while initializing the
chained demuxer, the parent demuxer's streams aren't set up
yet, so we can't recheck the discard flags.
Signed-off-by: Martin Storsjö <martin@martin.st>
This serves as a safeguard; normally we want to use the dts
comparison to interleave packets from all active variants. If that
dts comparison for some reason doesn't work as intended, make sure
that all packets in all variants for a certain sequence number have
been returned before moving on to the next one.
Signed-off-by: Martin Storsjö <martin@martin.st>
Incomplete crypted files would lead to a read after buffer boundary
otherwise.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Derived from VLC's http module.
Original authors:
Antoine Cellerier <dionoea@videolan.org>
Sébastien Escudier <sebastien-devel@celeos.eu>
Rémi Duraffort <ivoire@videolan.org>
Rémi Denis-Courmont <remi@remlab.net>
Francois Cartegnie <fcvlcdev@free.fr>
Normally, http servers shouldn't send this to us since we
don't advertise it with an Accept-Encoding header, but some
servers still do it anyway.
Signed-off-by: Martin Storsjö <martin@martin.st>