summaryrefslogtreecommitdiff
path: root/libavformat/hls.c
Commit message (Collapse)AuthorAge
* avformat/hls: propagate icy to child AVIOContextsMarvin Scholz2019-12-27
| | | | | | | | | | | When the user decides they do not want to to send the Icy-MetaData header, this should be respected for all requests, not just the first one. Fix #5578 Reviewed-by: Liu Steven <lq@chinaffmpeg.org> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/hls: Use av_packet_move_ref() for packet ownership transferAndreas Rheinhardt2019-12-23
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/hls: correct grammatical errors of m3u8_hold_counters optionSteven Liu2019-11-27
| | | | | | Suggested-by: Gyan <ffmpeg@gyani.pro> Suggested-by: Rodney Baker <rodney.baker@iinet.net.au> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hls: add option for the m3u8 list load max timesSteven Liu2019-11-25
| | | | | | | set max times for load m3u8 when the m3u8 list refresh do not with new segments any times. Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hls: continue to play enabled playlist when have failed playlistSteven Liu2019-11-13
| | | | | | fix ticket: 7811 Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* lavf/hls: support probesize/max_analyze_duration when open sub-demuxerJun Zhao2019-11-08
| | | | | | | Add probesize/max_analyze_duration support when open the sub-demuxer, it's will be used to minimizing the initial delay. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/hls: fix the log context setting in log messageJun Zhao2019-11-08
| | | | | | Fix the log context setting in log message Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avformat/hls: Set AVFMT_TS_DISCONT flag on HLS input formatPhilip Langdale2019-10-30
| | | | | | | | | | | | | | | | | | | | | | | | | | There have been many reports over the years about problems when taking an HLS stream as input to `ffmpeg` where there are timestamp discontinuities present. This is explicitly supported in the HLS spec (EXT-X-DISCONTINUITY) and often used for ad injection. Various fixes and work-arounds have been proposed over the years, but one step that seems obvious, even if it's not a complete fix, is to mark the HLS input format as supporting discontinuities. This will prevent timestamp fixup logic in ffmpeg.c kicking in that ends up mangling the timestamps unnecessarily. I've tested this out with an example provided by Joe Koberg early last year, and it is sufficient to allow `ffmpeg` to download and mux the stream correctly. Joe had briefly suggested that other situations can still be handled incorrectly, but this seems like a strict improvement. Joe's example: https://s3.amazonaws.com/playon-test-videos/discont_test_new/discont_test.m3u8 Reviewed-by: Steven Liu <lq@onvideo.cn> Reviewed-by: Dennis Mungai <dmngaie@gmail.com>
* avformat/hls: fix missing segment offset reset on last segment when ↵vectronic2019-10-08
| | | | | | | http_multiple is enabled. Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: vectronic <hello.vectronic@gmail.com>
* avformat/hls: pass http offset options to http requestvectronic2019-10-08
| | | | | | | | made with persistent connections to prevent incorrect reset of offset when demuxing HLS+FMP4 Signed-off-by: Steven Liu <lq@onvideo.cn> Signed-off-by: vectronic <hello.vectronic@gmail.com>
* lavf/hls: fix memory leak in error handling path for option tmpJun Zhao2019-09-14
| | | | | | | fix memory leak in error handling path for option tmp. Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/hls: remove redundancy seekable settingJun Zhao2019-09-14
| | | | | | | | ffio_init_context with NULL seek callback will setting seekable with 0, so remove the redundancy seekable setting. Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/hls: drop unnecessary check before ff_format_io_closeJun Zhao2019-09-14
| | | | | | | | ff_format_io_close will check the AVIOContext pointer pb, so drop the unnecessary check before ff_format_io_close. Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/hls: refine the log messageJun Zhao2019-09-14
| | | | | | | refine the log message, it's will help the debugging Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/hls: add http_seekable option for HTTP partial requestsJun Zhao2019-08-08
| | | | | | | | | | Add http_seekable option for HTTP partial requests, when The EXT-X-BYTERANGE tag indicates that a Media Segment is a sub-range of the resource identified by its URI, we can use HTTP partial requests to get the Media Segment. Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/hls: replace the same code logic with ensure_playlist()vacingfang2019-07-26
| | | | | | | | Replace the same code logic with ensure_playlist(), it's will help reusable blocks of code. Reviewed-by: Jun Zhao <barryjzhao@tencent.com> Signed-off-by: vacingfang <vacingfang@tencent.com>
* lavf/hls: remove redundancy reset_packet() after av_packet_unref()Jun Zhao2019-07-26
| | | | | | | | av_packet_unref have reseted the AVPacket, so don't need to call reset_packet after that. Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/hls: More log messageJun Zhao2019-06-14
| | | | | | | More log message, it's will help the debugging Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avformat/hls: add http 2.0 version number compare for the http_multipleSteven Liu2019-06-14
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hls: avformat_find_stream_info when the audio list in the variantSteven Liu2019-06-14
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* lavf/hls: Update av_log() log messageJun Zhao2019-06-07
| | | | | | | | Pass correct pointer to av_log() and update some error/warning message, it's will help the debugging Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/hls: Remove HLSContext.strict_std_compliance fieldJun Zhao2019-04-27
| | | | | | | After the commit 9f61abc8111, we can use AVFormatContext.strict_std_compliance instead of HLSContext.strict_std_compliance to avoid the code redundancy. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/hls: Cleanup the applehttpJun Zhao2019-04-15
| | | | | | | | | | | | | | | | | | | | Cleanup the applehttp as demuxer name, when use the command : ffmpeg -formats, get the confused information like: " E hls Apple HTTP Live Streaming D hls,applehttp Apple HTTP Live Streaming " we don't use applehttp as the demuxer/muxer name usually, so cleanup the applehttp and update the documents. After the change, get the information from "ffmpeg -formats": " DE hls Apple HTTP Live Streaming " Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avformat/hls: make different warning message between open url and parse playlistSteven Liu2019-04-02
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* lavf: Constify the probe function argument.Carl Eugen Hoyos2019-03-21
| | | | | Reviewed-by: Lauri Kasanen Reviewed-by: Tomas Härdin
* lavf: Constify AVInputFormat pointer.Carl Eugen Hoyos2019-03-20
|
* lavc/hls: Cosmetics: Fix indentation for free_segment_listJun Zhao2019-01-19
| | | | | | Commit 673d8cfd518 missed the indent Signed-off-by: Jun Zhao <mypopydev@gmail.com>
* avformat/hls.c: Properly free prev_segments dynarray after playlist parsingvkot2018-12-26
|
* avformat/hls: support decryption AES128 fmp4 m3u8 listSteven Liu2018-08-22
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hls: fix seeking around EVENT playlist after media sequence changesAman Gupta2018-05-16
| | | | | | | The seek functions use first_timestamp, so keep that up to date as old segments drop off the playlist. Signed-off-by: Aman Gupta <aman@tmm1.net>
* avformat/hls: don't propagate deprecated "user-agent" AVOptionwm42018-05-04
| | | | | | | | | This code will print a warning if any user agent is set - even if the API user used the proper non-deprecated "user_agent" option. This change should not even break anything, because even if the user sets the deprecated "user-agent" option, http.c copies it to the "user_agent" option anyway.
* avformat/hls: remove redundant codeSteven Liu2018-04-18
| | | | | Suggested-by: Richard Shaffer <rshaffer@tunein.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hls: clean up duplicate option fieldsRichard Shaffer2018-04-17
| | | | | | | | | | | | | | The HLSContext struct contains fields which duplicate the data stored in the avio_opts field. This change removes those fields in favor of avio_opts, and updates the code accordingly. The original patch caused the buffer pointed to by new_cookies in open_url to be leaked. The only thing that buffer is used for is to store the value until it can be passed to av_dict_set. To fix the leak, v2 of the patch simply calls av_dict_set with the AV_DICT_DONT_STRDUP_VAL flag, so that the dictionary takes ownership of the memory instead of copying it again. Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Richard Shaffer <rshaffer@tunein.com>
* avformat/hls: copy rw_timeout from parent to child AVIOContexts.Richard Shaffer2018-04-17
| | | | | | | | | | | The rw_timeout option is currently not applied when opening media playlist, segment, or encryption key URLs. This can cause the HLS demuxer to block indefinitely, even when the rw_timeout option has been specified. This change simply enables carrying over the rw_timeout option when the demuxer opens these URLs. Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Richard Shaffer <rshaffer@tunein.com>
* Revert "avformat/hls: copy rw_timeout from parent to child AVIOContexts."Steven Liu2018-04-17
| | | | This reverts commit 36deec010cc87c8990477e1703dbf785212992b5.
* avformat/hls: copy rw_timeout from parent to child AVIOContexts.Steven Liu2018-04-17
| | | | | | | | | | | The rw_timeout option is currently not applied when opening media playlist, segment, or encryption key URLs. This can cause the HLS demuxer to block indefinitely, even when the rw_timeout option has been specified. This change simply enables carrying over the rw_timeout option when the demuxer opens these URLs. Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Richard Shaffer <rshaffer@tunein.com>
* avformat/hls: remove redundant codeSteven Liu2018-04-17
| | | | | Reviewed-by: Jun Zhao <mypopydev@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* lavf/hls: use ff_get_chomp_lineJun Zhao2018-04-12
| | | | Signed-off-by: Jun Zhao <mypopydev@gmail.com>
* lavf/hls: Remove the dead code in parse_playlist()Jun Zhao2018-04-04
| | | | | Signed-off-by: Jun Zhao <mypopydev@gmail.com> Reviewed-by: Steven Liu <lq@onvideo.cn>
* avformat/hls: Support metadata updates from subdemuxersRichard Shaffer2018-02-07
| | | | | | | | If a subdemuxer has the updated metadata event flag set, the metadata is copied to the corresponding stream. The flag is cleared on the subdemuxer and the appropriate event flag is set on the stream. Signed-off-by: wm4 <nfxjfg@googlemail.com>
* avformat/hls: store referer message in HLS http requestSteven Liu2018-02-01
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hls: migrate to AVFormatContext->urlMarton Balint2018-01-28
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* hls: don't print a certain warning if playlist loading is abortedwm42018-01-27
| | | | | | AVERROR_EXIT happens when the user's interrupt callback signals that playback should be aborted. In this case, the demuxer shouldn't print a warning, as it's expected that all network accesses are stopped.
* avformat, hls: add a flag to signal unavailability of seekingwm42018-01-27
| | | | | | The seek function can just return an error if seeking is unavailable, but often this is too late. Add a flag that signals that the stream is unseekable, and use it in HLS.
* hls: do not allow fallback to generic seekingwm42018-01-27
| | | | | | This makes little sense due to how HLS works, and only causes some additional annoyances if the HLS read_seek function fails (for example if it's a live stream). It was most likely unintended.
* avformat/hls: release mem resource to fix memleakSteven Liu2017-12-31
| | | | | | | | fix CID: 1426991 Signed-off-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Aman Gupta <aman@tmm1.net> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avformat/hls: ignore http_persistent for segments requring cryptoAman Gupta2017-12-30
| | | | | | | | | | | | | Encrypted HLS segments have regular http:// urls, but open_input() actually prefixes them with crypto+ before calling open_url(), so they end up using the crypto protocol and not the http protocol. This means invoking ff_http_do_new_request will fail, so we avoid calling it in the first place. After the earlier http.c commit, the failure results in a warning printed to the user. In earlier versions, the failure would cause a segfault. Signed-off-by: Aman Gupta <aman@tmm1.net>
* avformat/hls: enable http_multiple only for http/1.1 serversAman Gupta2017-12-26
| | | | | | | | Some http/1.0 implementations, like python's SimpleHTTPServer, can only support one client connection at a time. Making a second request while the first is still connected leads to a deadlock. This change enables multiple connections for http/1.1 servers only, which need to support keepalive by default and should have no problem with concurrent requests. Signed-off-by: Aman Gupta <aman@tmm1.net>
* avformat/hls: respect http_persistent only for http playlist urlsAman Gupta2017-12-26
| | | | | | Fixes a segfault when reading a live playlist (without end tag) from non-http url (like a file on disk). Signed-off-by: Aman Gupta <aman@tmm1.net>
* avformat/hls: return AVERROR_PROTOCOL_NOT_FOUND when http protocol is not ↵Aman Gupta2017-12-26
| | | | | | | | | | available Fixes compile error when building with network or protocols disabled. This code would never be reached (because the demuxer fails much earlier on http playlists or segments), so it doesn't matter much what we do here as long as it compiles. Signed-off-by: Aman Gupta <aman@tmm1.net>