Session data (cookies, user-agent) is not being sent on payload requests with
encrypted HLS streams This causes services like Akamai to give a 403 forbidden
when requesting the TS files, because they expect the same cookies
and user-agent on all requests
Not all "sub-playlists" are variant playlists (containing the same
content with a different bitrate, etc) in the current version of the HLS
specification. They can now also be alternative renditions, containing
e.g. alternative audio tracks etc.
Decouple playlists from variants to prepare for handling the new
features.
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
* commit '8c929098141ebc94ad3f303521c520bb3dc6d8f6':
hls: Check whether the AVIOContext contains a new redirected URL
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This allows both the main playlist itself as well as the variant
playlists to handle redirects combined with relative URLs.
Signed-off-by: Martin Storsjö <martin@martin.st>
* qatar/master:
hls: Call avformat_find_stream_info() on the chained demuxers
Conflicts:
libavformat/hls.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This allows the chained demuxer (or more precisely, the lavf
utility code) to better fill in timestamps on packets from
these, especially for cases where one stream is a raw ADTS
stream.
Signed-off-by: Martin Storsjö <martin@martin.st>
* commit '06205b5efdcf0bc4c5463bfdd02f09b5f79fc4cd':
hls: Free packets when skipping packets when seeking
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'c44191039944526dd7eb6e536990b555837961f5':
hls: Store all durations in AV_TIME_BASE
Conflicts:
libavformat/hls.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'e1d5b244761cf69db655ad7ece1dbf2c13dd4fce':
hls: Store first_timestamp in units of AV_TIME_BASE
Conflicts:
libavformat/hls.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
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>
* 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>
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>
As far as I can tell the code should not change behaviour
depending on locale in any of these places.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
As the name indicates we can't just assume what the
"opaque" field contains.
This fixes a crash in third-party applications see e.g.:
http://bugzilla.mplayerhq.hu/show_bug.cgi?id=2126
This fixes also FFmpeg trac #2293, which is a different
third-party application.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Without the information, application may choose audio from one variant
and video from another variant, which leads to fetch two variants from
network. This enables av_find_best_stream() to find matching audio and
video streams, so that only one variant is fetched from network.
Signed-off-by: LYF <yefei.li@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Some HLS servers return 403 when the Range header is present. Disabling http
seekability probing prevents the header from being added.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* qatar/master:
avformat: Drop pointless "format" from container long names
swscale: bury one more piece of inline asm under HAVE_INLINE_ASM.
wv: K&R formatting cosmetics
configure: Add missing descriptions to help output
h264_ps: declare array of colorspace strings on its own line.
fate: amix: specify f32 sample format for comparison
tiny_psnr: support 32-bit float samples
eamad/eatgq/eatqi: call special EA IDCT directly
eamad: remove use of MpegEncContext
mpegvideo: remove unnecessary inclusions of faandct.h
af_asyncts: avoid overflow in out_size with large delta values
af_asyncts: add first_pts option
Conflicts:
configure
libavcodec/eamad.c
libavcodec/h264_ps.c
libavformat/crcenc.c
libavformat/ffmdec.c
libavformat/ffmenc.c
libavformat/framecrcenc.c
libavformat/md5enc.c
libavformat/nutdec.c
libavformat/rawenc.c
libavformat/yuv4mpeg.c
tests/tiny_psnr.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* qatar/master: (35 commits)
h264_idct_10bit: port x86 assembly to cpuflags.
x86inc: clip num_args to 7 on x86-32.
x86inc: sync to latest version from x264.
fft: rename "z" to "zc" to prevent name collision.
wv: return meaningful error codes.
wv: return AVERROR_EOF on EOF, not EIO.
mp3dec: forward errors for av_get_packet().
mp3dec: remove a pointless local variable.
mp3dec: remove commented out cruft.
lavfi: bump minor to mark stabilizing the ABI.
FATE: add tests for yadif.
FATE: add a test for delogo video filter.
FATE: add a test for amix audio filter.
audiogen: allow specifying random seed as a commandline parameter.
vc1dec: Override invalid macroblock quantizer
vc1: avoid reading beyond the last line in vc1_draw_sprites()
vc1dec: check that coded slice positions and interlacing match.
vc1dec: Do not ignore ff_vc1_parse_frame_header_adv return value
configure: Move parts that should not be user-selectable to CONFIG_EXTRA
lavf: remove commented out cruft in avformat_find_stream_info()
...
Conflicts:
Makefile
configure
libavcodec/vc1dec.c
libavcodec/x86/h264_deblock.asm
libavcodec/x86/h264_deblock_10bit.asm
libavcodec/x86/h264dsp_mmx.c
libavfilter/version.h
libavformat/mp3dec.c
libavformat/utils.c
libavformat/wv.c
libavutil/x86/x86inc.asm
Merged-by: Michael Niedermayer <michaelni@gmx.at>