Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-06-29 20:49:41 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-01 14:33:45 +0300
commitd7abedc90443d6bbd7e956fd53d91b343cba50a8 (patch)
tree6c51b693dad8329e8a466b7a1a3aa807ccb3fd95
parent2a5219d359933b4d6a4ccf13e241253543fc390e (diff)
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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c
index 50321ccbaa..5a09f91f3b 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -1890,6 +1890,7 @@ static int hls_read_header(AVFormatContext *s)
for (i = 0; i < c->n_playlists; i++) {
struct playlist *pls = c->playlists[i];
AVInputFormat *in_fmt = NULL;
+ char *url;
if (!(pls->ctx = avformat_alloc_context())) {
ret = AVERROR(ENOMEM);
@@ -1925,8 +1926,9 @@ static int hls_read_header(AVFormatContext *s)
ffio_init_context(&pls->pb, pls->read_buffer, INITIAL_BUFFER_SIZE, 0, pls,
read_data, NULL, NULL);
pls->pb.seekable = 0;
- 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