[MPlayer-dev-eng] [PATCH 2/2] demux_lavf: Also add AV_CODEC_ID_OTF attachments

Alexander Strasser eclipse7 at gmx.net
Sat Oct 25 02:07:26 CEST 2014


Make those font attachments work with demux_lavf.

Fix other part of 2207

Signed-off-by: Alexander Strasser <eclipse7 at gmx.net>
---
 libmpdemux/demux_lavf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
index de523df..ddc05d6 100644
--- a/libmpdemux/demux_lavf.c
+++ b/libmpdemux/demux_lavf.c
@@ -483,10 +483,11 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) {
             break;
         }
         case AVMEDIA_TYPE_ATTACHMENT:{
-            if (st->codec->codec_id == AV_CODEC_ID_TTF) {
+            if (st->codec->codec_id == AV_CODEC_ID_TTF || st->codec->codec_id == AV_CODEC_ID_OTF) {
                 AVDictionaryEntry *fnametag = av_dict_get(st->metadata, "filename", NULL, 0);
+                AVDictionaryEntry *mimetype = av_dict_get(st->metadata, "mimetype", NULL, 0);
                 demuxer_add_attachment(demuxer, fnametag ? fnametag->value : NULL,
-                                       "application/x-truetype-font",
+                                       mimetype ? mimetype->value : "application/x-truetype-font",
                                        codec->extradata, codec->extradata_size);
             }
             break;
-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <https://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20141025/7d9afef1/attachment.asc>


More information about the MPlayer-dev-eng mailing list