[FFmpeg-devel] [PATCH 2/3] hls: get/set protocol options through the AVIOContext

Schenk, Michael Michael.Schenk at albistechnologies.com
Mon Mar 14 15:06:12 CET 2016


Dear friends,

I fully agree with Hendrik on that point and I'm trapping into the same problems

Regards

Michael

-----Ursprüngliche Nachricht-----
Von: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] Im Auftrag von Hendrik Leppkes
Gesendet: Montag, 14. März 2016 12:23
An: ffmpeg-devel at ffmpeg.org
Betreff: [FFmpeg-devel] [PATCH 2/3] hls: get/set protocol options through the AVIOContext

This avoids directly accessing the void opaque type.
---
 libavformat/hls.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c index a6dcbd2..714d1e0 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -584,7 +584,7 @@ static int ensure_playlist(HLSContext *c, struct playlist **pls, const char *url  static void update_options(char **dest, const char *name, void *src)  {
     av_freep(dest);
-    av_opt_get(src, name, 0, (uint8_t**)dest);
+    av_opt_get(src, name, AV_OPT_SEARCH_CHILDREN, (uint8_t**)dest);
     if (*dest && !strlen(*dest))
         av_freep(dest);
 }
@@ -614,7 +614,7 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
     ret = s->io_open(s, pb, url, AVIO_FLAG_READ, &tmp);
     if (ret >= 0) {
         // update cookies on http response with setcookies.
-        void *u = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb->opaque;
+        void *u = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb;
         update_options(&c->cookies, "cookies", u);
         av_dict_set(&opts, "cookies", c->cookies, 0);
     }
@@ -1496,7 +1496,7 @@ static int nested_io_open(AVFormatContext *s, AVIOContext **pb, const char *url,
 
 static int hls_read_header(AVFormatContext *s)  {
-    void *u = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb->opaque;
+    void *u = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb;
     HLSContext *c = s->priv_data;
     int ret = 0, i, j, stream_offset = 0;
 
--
2.7.2.windows.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel at ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list