changeset 4596:34aa256311f0 libavformat

use new metadata API in wc3 demuxer
author aurel
date Thu, 26 Feb 2009 22:35:26 +0000
parents af7b24671b7d
children ff780d8f1bbc
files wc3movie.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/wc3movie.c	Thu Feb 26 22:34:18 2009 +0000
+++ b/wc3movie.c	Thu Feb 26 22:35:26 2009 +0000
@@ -132,6 +132,7 @@
     unsigned int size;
     AVStream *st;
     unsigned char preamble[WC3_PREAMBLE_SIZE];
+    char buffer[513];
     int ret = 0;
     int current_palette = 0;
     int bytes_to_read;
@@ -185,8 +186,10 @@
                 bytes_to_read = size;
             else
                 bytes_to_read = 512;
-            if ((ret = get_buffer(pb, s->title, bytes_to_read)) != bytes_to_read)
+            if ((ret = get_buffer(pb, buffer, bytes_to_read)) != bytes_to_read)
                 return AVERROR(EIO);
+            buffer[bytes_to_read] = 0;
+            av_metadata_set(&s->metadata, "title", buffer);
             break;
 
         case SIZE_TAG: