[SCM] libav/experimental: makes the filename member of the URLContext a pointer, so that the structure can be extended in the future without breaking ABI. patch by Ronald S. Bultje % rbultje A ronald P bitfreak P net % Original thread: Date: Jan 1, 2007 6:01 PM Subject: [Ffmpeg-devel] make URLContext->filename a pointer

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:54:55 UTC 2013


The following commit has been merged in the experimental branch:
commit 621810045cc0b5174e0243796026eb622b985a6c
Author: Ronald S. Bultje <rsbultje at gmail.com>
Date:   Sun Jan 14 22:07:19 2007 +0000

    makes the filename member of the URLContext a pointer, so that the
    structure can be extended in the future without breaking ABI.
    patch by Ronald S. Bultje % rbultje A ronald P bitfreak P net %
    Original thread:
    Date: Jan 1, 2007 6:01 PM
    Subject: [Ffmpeg-devel] make URLContext->filename a pointer
    
    Originally committed as revision 7506 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/avio.c b/libavformat/avio.c
index dc40384..44bc3af 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -70,11 +70,14 @@ int url_open(URLContext **puc, const char *filename, int flags)
     err = -ENOENT;
     goto fail;
  found:
-    uc = av_malloc(sizeof(URLContext) + strlen(filename));
+    uc = av_malloc(sizeof(URLContext) + strlen(filename) + 1);
     if (!uc) {
         err = -ENOMEM;
         goto fail;
     }
+#if LIBAVFORMAT_VERSION_INT >= (52<<16)
+    uc->filename = (char *) &uc[1];
+#endif
     strcpy(uc->filename, filename);
     uc->prot = up;
     uc->flags = flags;
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 3f733f0..f44d526 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -33,7 +33,11 @@ struct URLContext {
     int is_streamed;  /* true if streamed (no seek possible), default = false */
     int max_packet_size;  /* if non zero, the stream is packetized with this max packet size */
     void *priv_data;
+#if LIBAVFORMAT_VERSION_INT >= (52<<16)
+    char *filename; /* specified filename */
+#else
     char filename[1]; /* specified filename */
+#endif
 };
 
 typedef struct URLContext URLContext;

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list