changeset 33190:0220b3e9d5c5

Use metadata tag API to get attachment filename.
author reimar
date Fri, 22 Apr 2011 06:17:34 +0000
parents e137435bb751
children 32238139a2ff
files libmpdemux/demux_lavf.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_lavf.c	Fri Apr 22 06:15:50 2011 +0000
+++ b/libmpdemux/demux_lavf.c	Fri Apr 22 06:17:34 2011 +0000
@@ -456,10 +456,12 @@
             break;
         }
         case AVMEDIA_TYPE_ATTACHMENT:{
-            if (st->codec->codec_id == CODEC_ID_TTF)
-                demuxer_add_attachment(demuxer, st->filename,
+            if (st->codec->codec_id == CODEC_ID_TTF) {
+                AVMetadataTag *fnametag = av_metadata_get(st->metadata, "filename", NULL, 0);
+                demuxer_add_attachment(demuxer, fnametag ? fnametag->value : NULL,
                                        "application/x-truetype-font",
                                        codec->extradata, codec->extradata_size);
+            }
             break;
         }
         default: