diff avio.c @ 19:81e87c8de3dc libavformat

added url_get_filename()
author bellard
date Sat, 11 Jan 2003 04:59:17 +0000
parents 05318cf2e886
children 22e4d9d88e25
line wrap: on
line diff
--- a/avio.c	Sat Jan 11 04:58:36 2003 +0000
+++ b/avio.c	Sat Jan 11 04:59:17 2003 +0000
@@ -61,11 +61,12 @@
     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 @@
 {
     return h->max_packet_size;
 }
+
+void url_get_filename(URLContext *h, char *buf, int buf_size)
+{
+    pstrcpy(buf, buf_size, h->filename);
+}