[FFmpeg-cvslog] avformat/hls: pass http offset options to http request

vectronic git at videolan.org
Tue Oct 8 10:00:00 EEST 2019


ffmpeg | branch: master | vectronic <hello.vectronic at gmail.com> | Fri Oct  4 22:56:02 2019 +0100| [b21c5ef501d13fdebea42eca8437af67dfe2d481] | committer: Steven Liu

avformat/hls: pass http offset options to http request

made with persistent connections to prevent incorrect reset of
offset when demuxing HLS+FMP4

Signed-off-by: Steven Liu <lq at onvideo.cn>
Signed-off-by: vectronic <hello.vectronic at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b21c5ef501d13fdebea42eca8437af67dfe2d481
---

 libavformat/hls.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 0611ddc6bb..336608fa2d 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -594,7 +594,7 @@ static int ensure_playlist(HLSContext *c, struct playlist **pls, const char *url
 }
 
 static int open_url_keepalive(AVFormatContext *s, AVIOContext **pb,
-                              const char *url)
+                              const char *url, AVDictionary **options)
 {
 #if !CONFIG_HTTP_PROTOCOL
     return AVERROR_PROTOCOL_NOT_FOUND;
@@ -603,7 +603,7 @@ static int open_url_keepalive(AVFormatContext *s, AVIOContext **pb,
     URLContext *uc = ffio_geturlcontext(*pb);
     av_assert0(uc);
     (*pb)->eof_reached = 0;
-    ret = ff_http_do_new_request(uc, url);
+    ret = ff_http_do_new_request2(uc, url, options);
     if (ret < 0) {
         ff_format_io_close(s, pb);
     }
@@ -656,7 +656,7 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
     av_dict_copy(&tmp, opts2, 0);
 
     if (is_http && c->http_persistent && *pb) {
-        ret = open_url_keepalive(c->ctx, pb, url);
+        ret = open_url_keepalive(c->ctx, pb, url, &tmp);
         if (ret == AVERROR_EXIT) {
             av_dict_free(&tmp);
             return ret;
@@ -714,7 +714,7 @@ static int parse_playlist(HLSContext *c, const char *url,
 
     if (is_http && !in && c->http_persistent && c->playlist_pb) {
         in = c->playlist_pb;
-        ret = open_url_keepalive(c->ctx, &c->playlist_pb, url);
+        ret = open_url_keepalive(c->ctx, &c->playlist_pb, url, NULL);
         if (ret == AVERROR_EXIT) {
             return ret;
         } else if (ret < 0) {



More information about the ffmpeg-cvslog mailing list