[SCM] libav/experimental: added url_get_filename()

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:34:53 UTC 2013


The following commit has been merged in the experimental branch:
commit f746a0461694a8951d003395d79af8eba9dae5ed
Author: Fabrice Bellard <fabrice at bellard.org>
Date:   Sat Jan 11 04:59:17 2003 +0000

    added url_get_filename()
    
    Originally committed as revision 1438 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/avio.c b/libavformat/avio.c
index 37af56f..ac041a3 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);
+}
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 541eff5..4ed359c 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -13,6 +13,7 @@ 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;
+    char filename[1]; /* specified filename */
 };
 
 typedef struct URLContext URLContext;
@@ -35,6 +36,8 @@ int url_close(URLContext *h);
 int url_exist(const char *filename);
 offset_t url_filesize(URLContext *h);
 int url_get_max_packet_size(URLContext *h);
+void url_get_filename(URLContext *h, char *buf, int buf_size);
+
 /* not implemented */
 int url_poll(URLPollEntry *poll_table, int n, int timeout);
 

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list