changeset 1648:90987914ad57 libavformat

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
author gpoirier
date Sun, 14 Jan 2007 22:07:19 +0000
parents 0a990429e524
children 46d5a151ca4f
files avio.c avio.h
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/avio.c	Sun Jan 14 22:02:38 2007 +0000
+++ b/avio.c	Sun Jan 14 22:07:19 2007 +0000
@@ -70,11 +70,14 @@
     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;
--- a/avio.h	Sun Jan 14 22:02:38 2007 +0000
+++ b/avio.h	Sun Jan 14 22:07:19 2007 +0000
@@ -33,7 +33,11 @@
     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;