[FFmpeg-devel] [PATCH 1/3] Revert "hls: Add and use a memebr of AVIOInternal rather than abuse opaque"

Schenk, Michael Michael.Schenk at albistechnologies.com
Mon Mar 14 15:05:58 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 1/3] Revert "hls: Add and use a memebr of AVIOInternal rather than abuse opaque"

This reverts commit 9f9ed79d4cb40e5d9093899f8a79086ff23da844.

The hlsopts member was never set anywhere and always NULL, furthermore the HLS demuxer needs to retrieve the proper options from the underlying http protocol (cookies, user-agent, etc), so a dummy context won't help.
---
 libavformat/avio_internal.h | 5 -----
 libavformat/aviobuf.c       | 4 ++++
 libavformat/hls.c           | 6 ++----
 3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/libavformat/avio_internal.h b/libavformat/avio_internal.h index ba9bd4e..3867be6 100644
--- a/libavformat/avio_internal.h
+++ b/libavformat/avio_internal.h
@@ -24,11 +24,6 @@
 
 #include "libavutil/log.h"
 
-typedef struct AVIOInternal {
-    URLContext *h;
-    void *hlsopts;
-} AVIOInternal;
-
 extern const AVClass ff_avio_class;
 
 int ffio_init_context(AVIOContext *s,
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 00f7c5a..f2f03f6 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -42,6 +42,10 @@
  */
 #define SHORT_SEEK_THRESHOLD 4096
 
+typedef struct AVIOInternal {
+    URLContext *h;
+} AVIOInternal;
+
 static void *ff_avio_child_next(void *obj, void *prev)  {
     AVIOContext *s = obj;
diff --git a/libavformat/hls.c b/libavformat/hls.c index 61ab5c8..a6dcbd2 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -614,8 +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.
-        AVIOInternal *internal = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb->opaque;
-        void *u = internal ? internal->hlsopts : NULL;
+        void *u = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : 
+ s->pb->opaque;
         update_options(&c->cookies, "cookies", u);
         av_dict_set(&opts, "cookies", c->cookies, 0);
     }
@@ -1497,8 +1496,7 @@ static int nested_io_open(AVFormatContext *s, AVIOContext **pb, const char *url,
 
 static int hls_read_header(AVFormatContext *s)  {
-    AVIOInternal *internal = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb->opaque;
-    void *u = internal ? internal->hlsopts : NULL;
+    void *u = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb->opaque;
     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