diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-06-29 19:49:41 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-07-02 10:20:36 +0200 |
commit | a3fdeb0c3a4ecabab2c2351b86fc92004526e9cc (patch) | |
tree | ea371511f6a22e7abf2b43d8b8d2e2bc7e385252 | |
parent | 199d6a049a90e03f0e61b6a859c9f0fe8ac69251 (diff) | |
download | ffmpeg-a3fdeb0c3a4ecabab2c2351b86fc92004526e9cc.tar.gz |
avformat/hls: Pass a copy of the URL for probing
The segments / url can be modified by the io read when reloading
This may be an alternative or additional fix for Ticket8673
as a further alternative the reload stuff could be disabled during
probing
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b5e39880fb7269b1b3577cee288e06aa3dc1dfa2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/hls.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c index 17b3dd545d..3c7e197ce7 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -1932,6 +1932,7 @@ static int hls_read_header(AVFormatContext *s) /* Open the demuxer for each playlist */ for (i = 0; i < c->n_playlists; i++) { struct playlist *pls = c->playlists[i]; + char *url; ff_const59 AVInputFormat *in_fmt = NULL; if (!(pls->ctx = avformat_alloc_context())) { @@ -1969,8 +1970,9 @@ static int hls_read_header(AVFormatContext *s) read_data, NULL, NULL); pls->ctx->probesize = s->probesize > 0 ? s->probesize : 1024 * 4; pls->ctx->max_analyze_duration = s->max_analyze_duration > 0 ? s->max_analyze_duration : 4 * AV_TIME_BASE; - ret = av_probe_input_buffer(&pls->pb, &in_fmt, pls->segments[0]->url, - NULL, 0, 0); + url = av_strdup(pls->segments[0]->url); + ret = av_probe_input_buffer(&pls->pb, &in_fmt, url, NULL, 0, 0); + av_free(url); if (ret < 0) { /* Free the ctx - it isn't initialized properly at this point, * so avformat_close_input shouldn't be called. If |