summaryrefslogtreecommitdiff
path: root/libavformat/avio.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/avio.c')
-rw-r--r--libavformat/avio.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/avio.c b/libavformat/avio.c
index 37af56f9af..ac041a38cd 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -61,11 +61,12 @@ int url_open(URLContext **puc, const char *filename, int flags)
err = -ENOENT;
goto fail;
found:
- uc = av_malloc(sizeof(URLContext));
+ uc = av_malloc(sizeof(URLContext) + strlen(filename));
if (!uc) {
err = -ENOMEM;
goto fail;
}
+ strcpy(uc->filename, filename);
uc->prot = up;
uc->flags = flags;
uc->is_streamed = 0; /* default = not streamed */
@@ -154,3 +155,8 @@ int url_get_max_packet_size(URLContext *h)
{
return h->max_packet_size;
}
+
+void url_get_filename(URLContext *h, char *buf, int buf_size)
+{
+ pstrcpy(buf, buf_size, h->filename);
+}