changeset 4623:993860d53040 libavformat

use new metadata API in r3d demuxer
author aurel
date Sun, 01 Mar 2009 15:28:56 +0000
parents daee9ef28a39
children 3dfd5f8c63ee
files r3d.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/r3d.c	Sun Mar 01 14:50:03 2009 +0000
+++ b/r3d.c	Sun Mar 01 15:28:56 2009 +0000
@@ -51,6 +51,7 @@
 static int r3d_read_red1(AVFormatContext *s)
 {
     AVStream *st = av_new_stream(s, 0);
+    char filename[258];
     int tmp, tmp2;
 
     if (!st)
@@ -92,12 +93,11 @@
         av_set_pts_info(ast, 32, 1, st->time_base.den);
     }
 
-    st->filename = av_mallocz(258);
-    if (!st->filename)
-        return AVERROR(ENOMEM);
-    get_buffer(s->pb, st->filename, 257);
+    get_buffer(s->pb, filename, 257);
+    filename[sizeof(filename)-1] = 0;
+    av_metadata_set(&st->metadata, "filename", filename);
 
-    dprintf(s, "filename %s\n", st->filename);
+    dprintf(s, "filename %s\n", filename);
     dprintf(s, "resolution %dx%d\n", st->codec->width, st->codec->height);
     dprintf(s, "timescale %d\n", st->time_base.den);
     dprintf(s, "frame rate %d/%d\n",