summaryrefslogtreecommitdiff
path: root/libavformat/hls.c
Commit message (Collapse)AuthorAge
* Merge commit '9f61abc8111c7c43f49ca012e957a108b9cc7610'Derek Buitenhuis2016-02-10
|\ | | | | | | | | | | | | | | | | This also deprecates our old duplicated callbacks. * commit '9f61abc8111c7c43f49ca012e957a108b9cc7610': lavf: allow custom IO for all files Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: allow custom IO for all filesAnton Khirnov2016-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some (de)muxers open additional files beyond the main IO context. Currently, they call avio_open() directly, which prevents the caller from using custom IO for such streams. This commit adds callbacks to AVFormatContext that default to avio_open2()/avio_close(), but can be overridden by the caller. All muxers and demuxers using AVIO are switched to using those callbacks instead of calling avio_open()/avio_close() directly. (de)muxers that use the URLProtocol layer directly instead of AVIO remain unconverted for now. This should be fixed in later commits.
* | Update demuxers and protocols for protocol whitelist supportMichael Niedermayer2016-02-02
| | | | | | | | | | Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Revert "avformat/hls: Require the file extension to be m3u / m3u8 for ↵Michael Niedermayer2016-02-01
| | | | | | | | | | | | | | | | | | | | | | probing to succeed" This can cause problems with urls that have arguments after the filename This reverts commit b0c57206d583517a5ea35dd7f365f8260d9106f2. Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hls: Check that filename is not "" in probe before checking its ↵Michael Niedermayer2016-01-25
| | | | | | | | | | | | | | | | | | extension Possibly the check as a whole causes more problems than it helps, if so dont hesitate to remove it Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hls: Require the file extension to be m3u / m3u8 for probing to succeedMichael Niedermayer2016-01-19
| | | | | | | | | | | | If the filename isnt set by the user application then the code behaves like before Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hls: Even stricter URL checksMichael Niedermayer2016-01-15
| | | | | | | | | | | | This fixes a null pointer dereference at least Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hls: More strict url checksMichael Niedermayer2016-01-15
| | | | | | | | | | | | No case is known where these are needed Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hls: forbid all protocols except http(s) & fileMaxim Andreev2016-01-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hls: Added http_proxy supportJoel Holdsworth2015-12-27
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hls: Remember to free HLSContext::headersJoel Holdsworth2015-12-27
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat: Add av_program_add_stream_index()Michael Niedermayer2015-12-11
| | | | | | | | | | | | This will be used by the subsequent commit(s) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457'Hendrik Leppkes2015-10-27
|\| | | | | | | | | | | | | * commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457': avpacket: Replace av_free_packet with av_packet_unref Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * avpacket: Replace av_free_packet with av_packet_unrefLuca Barbato2015-10-26
| | | | | | | | | | | | | | `av_packet_unref` matches the AVFrame ref-counted API and can be used as a drop in replacement. Deprecate `av_free_packet`.
| * hls: Check av_opt_set_dict return value as wellLuca Barbato2015-10-01
| | | | | | | | Bug-Id: CID 1320426
* | avformat/hls: add support for EXT-X-MAPAnssi Hannula2015-10-15
| | | | | | | | | | | | | | | | | | Without EXT-X-MAP support we miss the first bytes of some streams. These streams worked by luck before byte-ranged segment support was added in da7759b3579de3e98deb1ac58e642b861280ba54 Fixes ticket #4797.
* | avformat/hls: fix segment selection regression on track changes of live streamsAnssi Hannula2015-10-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit ad701326b43078b90 ("avformat/hls: open playlists immediately when AVDISCARD_ALL is dropped") inadvertently caused first_packet to never be cleared, causing select_cur_seq_no() to not use the specific code for live streams. In practice this means that when the user selects a different audio track during live stream (i.e. non-VOD) playback, there may be some additional delay as the code might select an incorrect segment at first, and we have to wait for video to catch audio (if too late segment was selected) or to download more following audio segments (if too early segment was selected). Fix that by restoring the zeroing of first_packet.
* | lavf/hls: don't convert NULL options to empty strings; fixes HTTP CRLF warningsRodger Combs2015-10-09
| |
* | lavf/hls: allow subtitles to be read despite incomplete handlingRodger Combs2015-10-03
| | | | | | | | | | | | | | This will give incorrect results in some cases due to not parsing segments separately, so it currently requires -strict experimental. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hls: remove unused functionGanesh Ajjanagadde2015-09-26
| | | | | | | | | | | | | | Fixes -Wunused-function from http://fate.ffmpeg.org/report.cgi?time=20150820031140&slot=arm64-darwin-clang-apple-5.1 Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | avformat/hls: Update Cookies response with SetcookieLucas de Andrade2015-09-25
| | | | | | | | | | | | Context cookies must be updated when a playlist response return Setcookie header. Signed-off-by: wm4 <nfxjfg@googlemail.com>
* | hls: only seek if there is an offsetAndreas Cadhalpun2015-09-22
| | | | | | | | | | | | | | | | | | | | | | If there is no #EXT-X-BYTERANGE specified, there is no need to seek. Seeking fails anyway for rtmp, because this protocol does not support url_seek. This fixes CNN.m3u from trac ticket 4797 (i.e. Debian bug #798189). Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avformat/hls: fix some cases of HLS streams which require cookieswm42015-09-22
| | | | | | | | | | | | | | | | Broken by commit ba12ba859aabfa7153ba397d869db13acdaba340. This only happens with HLS streams which use encryption and require preserving cookies sent by the server. Fixes trac issue #4846.
* | avformat/hls: Check for av_opt_set_dict() failureMichael Niedermayer2015-09-05
| | | | | | | | | | | | Fixes: CID1320426 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hls: correct comment for ensure_playlist()Ganesh Ajjanagadde2015-08-21
| | | | | | | | | | | | | | | | Comment was previously slightly incorrect. Also, it was placed in the wrong location. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | FF_OPT_TYPE_* -> AV_OPT_TYPE_*.Ronald S. Bultje2015-08-18
| |
* | Merge commit '0c73a5a53cc97f4291bbe9e1e68226edf6161744'Michael Niedermayer2015-07-30
|\| | | | | | | | | | | | | | | | | | | * commit '0c73a5a53cc97f4291bbe9e1e68226edf6161744': hls: Save and forward avio options Conflicts: libavformat/hls.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * hls: Save and forward avio optionsLuca Barbato2015-07-30
| | | | | | | | | | | | Make possible to send the custom headers and override the user agent. Reported-by: BenWonder
* | Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '059a934806d61f7af9ab3fd9f74994b838ea5eba': lavc: Consistently prefix input buffer defines Conflicts: doc/examples/decoding_encoding.c libavcodec/4xm.c libavcodec/aac_adtstoasc_bsf.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.h libavcodec/asvenc.c libavcodec/avcodec.h libavcodec/avpacket.c libavcodec/dvdec.c libavcodec/ffv1enc.c libavcodec/g2meet.c libavcodec/gif.c libavcodec/h264.c libavcodec/h264_mp4toannexb_bsf.c libavcodec/huffyuvdec.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libxvid.c libavcodec/mdec.c libavcodec/motionpixels.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/noise_bsf.c libavcodec/nuv.c libavcodec/nvenc.c libavcodec/options.c libavcodec/parser.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/qsvdec.c libavcodec/svq1enc.c libavcodec/tiffenc.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/vc1dec.c libavcodec/wmalosslessdec.c libavformat/adxdec.c libavformat/aiffdec.c libavformat/apc.c libavformat/apetag.c libavformat/avidec.c libavformat/bink.c libavformat/cafdec.c libavformat/flvdec.c libavformat/id3v2.c libavformat/isom.c libavformat/matroskadec.c libavformat/mov.c libavformat/mpc.c libavformat/mpc8.c libavformat/mpegts.c libavformat/mvi.c libavformat/mxfdec.c libavformat/mxg.c libavformat/nutdec.c libavformat/oggdec.c libavformat/oggparsecelt.c libavformat/oggparseflac.c libavformat/oggparseopus.c libavformat/oggparsespeex.c libavformat/omadec.c libavformat/rawdec.c libavformat/riffdec.c libavformat/rl2.c libavformat/rmdec.c libavformat/rtpdec_latm.c libavformat/rtpdec_mpeg4.c libavformat/rtpdec_qdm2.c libavformat/rtpdec_svq3.c libavformat/sierravmd.c libavformat/smacker.c libavformat/smush.c libavformat/spdifenc.c libavformat/takdec.c libavformat/tta.c libavformat/utils.c libavformat/vqf.c libavformat/westwood_vqa.c libavformat/xmv.c libavformat/xwma.c libavformat/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hls: do not iterate to next sequence number if interruption is ↵schenk michael2015-06-26
| | | | | | | | | | | | requested Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/hls: Handle read_buffer allocation failureMichael Niedermayer2015-05-12
| | | | | | | | | | | | Fixes CID1297576 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | hls: skip to next segment if the current is unavailablewm42015-04-17
| | | | | | | | | | | | | | | | | | Apparently, some live streams can delete segments too early, maybe because the client is too far behind. In this case, it's better to skip the segment, instead of returning EOF. (Yes, the HLS demuxer actually returns AVERROR_EOF if opening the segment returns a 404 HTTP error.) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | libavformat/hls: add an option to start from a given segment in a live streamRodger Combs2015-03-29
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/hls: refactor repeated HLS option updatesMicah Galizia2015-03-16
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/hls: store cookies returned in HLS key responseMicah Galizia2015-03-16
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | hls: detect SAMPLE-AES encryptionselsta2015-03-05
| | | | | | | | | | | | | | | | SAMPLE-AES encryption is not commonly used yet, but without this patch ffmpeg is thinking that the hls segments are not encrypted which produces broken files. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | hls: fix a null pointer dereferencewm42015-02-16
| | | | | | | | | | | | | | | | | | Not allocating the pls->ctx will crash in libavformat/hls.c:1410, where it tries to dereference the field. Sample: http://ec24.rtp.pt/liverepeater/rtpn.smil/playlist.m3u8 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat: Add and use ff_copy_whitelists()Michael Niedermayer2014-10-24
| | | | | | | | | | | | | | Fixes potential security issue in case of running out of memory Found-by: ubitux Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '6df9d9b55d3f56ee7782639a7678eeeaf77f14ea'Michael Niedermayer2014-10-24
|\| | | | | | | | | | | | | | | | | | | | | * commit '6df9d9b55d3f56ee7782639a7678eeeaf77f14ea': lavf: Use av_gettime_relative Conflicts: libavformat/hls.c See: f78bc96b7c1c74caf99a7139cf81ce1110404965 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: Use av_gettime_relativeMartin Storsjö2014-10-24
| | | | | | | | | | | | | | | | | | The ones left using av_gettime are NTP timestamps (for RTCP, which is specified to send the actual current realtime clock in RTCP SR packets), and the NUT muxer timestamper, which is documented as using wallclock time. Signed-off-by: Martin Storsjö <martin@martin.st>
* | avformat/hls: forward whitelists to mpegts demuxerMichael Niedermayer2014-10-23
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/hls: use av_freep(), do not leave stale pointers in memoryMichael Niedermayer2014-10-07
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Use new av_dict_set_int helper function.Reimar Döffinger2014-08-16
| | | | | | | | | | | | | | Get rid of the many, slightly differing, implementations of basically the same thing. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | replace calls to url_feof() with avio_feof()James Almer2014-08-08
| | | | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/hls: reduce memory usage by using dynamically allocated url/keyMichael Schenk2014-04-12
| | | | | | | | Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
* | avformat/hls: do not call ffurl_seek/ffurl_size on crypto protocolAnssi Hannula2014-04-11
| | | | | | | | | | | | | | | | | | | | ffurl_seek() will not work even when it should be a no-op, so do not call it on crypto protocol. Also replace use of ffurl_size() for the same reason. Reported-by: Michael Schenk <Michael.Schenk@albistechnologies.com> Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
* | avformat/hls: support for seeking on event playlistsVladlen Y. Koshelev2014-04-06
| | | | | | | | | | This allows clients to seek between first played segment and the last one in the live stream playlist with #EXT-X-PLAYLIST-TYPE:EVENT attribute.
* | avformat/hls: flush the subdemuxer when seekingAnssi Hannula2014-04-06
| | | | | | | | | | | | | | | | Since we are basically seeking the AVIOContext under the subdemuxer, we need to flush the subdemuxer to avoid old packets from being read from the packet queue after the seek. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
* | avformat/hls: properly take stream_index into account when seekingAnssi Hannula2014-04-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Properly take stream_index into account so that a keyframe will be looked for in the specified stream_index only. Similarly, only check timestamp validity against the specified stream_index. Also remove code for stream_index == -1 case which does not actually happen as it is handled by generic code. This is based on an initial patch by James Deng. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
* | avformat/hls: open playlists immediately when AVDISCARD_ALL is droppedAnssi Hannula2014-04-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not try to delay opening newly required playlists until a segment switch. Applications expect that newly selected undiscarded streams are available immediately, especially with alternative rendition streams (selectable audio/subtitle tracks). One might think that delaying variant stream switch until a segment switch would allow a "seamless" switch without us having to download a specific segment from two different variant playlists. However, that is not the case, since the application would have to keep the previous stream available (undiscarded) until the first packet of the newly selected stream arrives, but by that time the demuxer would have already downloaded the next segment of both variants. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>