Skip to content
Snippets Groups Projects
Commit 62181004 authored by Ronald S. Bultje's avatar Ronald S. Bultje Committed by Guillaume Poirier
Browse files

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
parent fb2b4fc5
No related branches found
No related tags found
No related merge requests found
...@@ -70,11 +70,14 @@ int url_open(URLContext **puc, const char *filename, int flags) ...@@ -70,11 +70,14 @@ int url_open(URLContext **puc, const char *filename, int flags)
err = -ENOENT; err = -ENOENT;
goto fail; goto fail;
found: found:
uc = av_malloc(sizeof(URLContext) + strlen(filename)); uc = av_malloc(sizeof(URLContext) + strlen(filename) + 1);
if (!uc) { if (!uc) {
err = -ENOMEM; err = -ENOMEM;
goto fail; goto fail;
} }
#if LIBAVFORMAT_VERSION_INT >= (52<<16)
uc->filename = (char *) &uc[1];
#endif
strcpy(uc->filename, filename); strcpy(uc->filename, filename);
uc->prot = up; uc->prot = up;
uc->flags = flags; uc->flags = flags;
......
...@@ -33,7 +33,11 @@ struct URLContext { ...@@ -33,7 +33,11 @@ struct URLContext {
int is_streamed; /* true if streamed (no seek possible), default = false */ 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 */ int max_packet_size; /* if non zero, the stream is packetized with this max packet size */
void *priv_data; void *priv_data;
#if LIBAVFORMAT_VERSION_INT >= (52<<16)
char *filename; /* specified filename */
#else
char filename[1]; /* specified filename */ char filename[1]; /* specified filename */
#endif
}; };
typedef struct URLContext URLContext; typedef struct URLContext URLContext;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment