From 864acb01cc73762918794ddecf0fc2f7b6cf8529 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Brochet?= <blinkseb@xbmc.org>
Date: Sun, 15 Apr 2012 22:43:46 +0200
Subject: [PATCH 1/3] added: support for OTF fonts
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit


Signed-off-by: Sébastien Brochet <blinkseb@xbmc.org>
---
 lib/ffmpeg/libavcodec/avcodec.h                     |    1 +
 lib/ffmpeg/libavformat/matroska.c                   |    1 +
 xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp |    2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/ffmpeg/libavcodec/avcodec.h b/lib/ffmpeg/libavcodec/avcodec.h
index 0b756d0..6996c92 100644
--- a/lib/ffmpeg/libavcodec/avcodec.h
+++ b/lib/ffmpeg/libavcodec/avcodec.h
@@ -435,6 +435,7 @@ enum CodecID {
     CODEC_ID_BINTEXT    = MKBETAG('B','T','X','T'),
     CODEC_ID_XBIN       = MKBETAG('X','B','I','N'),
     CODEC_ID_IDF        = MKBETAG( 0 ,'I','D','F'),
+    CODEC_ID_OTF        = MKBETAG( 0 ,'O','T','F'),
 
     CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
 
diff --git a/lib/ffmpeg/libavformat/matroska.c b/lib/ffmpeg/libavformat/matroska.c
index 52481d7..2f5b617 100644
--- a/lib/ffmpeg/libavformat/matroska.c
+++ b/lib/ffmpeg/libavformat/matroska.c
@@ -90,6 +90,7 @@ const CodecMime ff_mkv_mime_tags[] = {
     {"image/tiff"                 , CODEC_ID_TIFF},
     {"application/x-truetype-font", CODEC_ID_TTF},
     {"application/x-font"         , CODEC_ID_TTF},
+    {"application/vnd.ms-opentype", CODEC_ID_OTF},
 
     {""                           , CODEC_ID_NONE}
 };
diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
index 17cbd48..4524141 100644
--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
@@ -1062,7 +1062,7 @@ void CDVDDemuxFFmpeg::AddStream(int iId)
       }
     case AVMEDIA_TYPE_ATTACHMENT:
       { //mkv attachments. Only bothering with fonts for now.
-        if(pStream->codec->codec_id == CODEC_ID_TTF)
+        if(pStream->codec->codec_id == CODEC_ID_TTF || pStream->codec->codec_id == CODEC_ID_OTF)
         {
           std::string fileName = "special://temp/fonts/";
           XFILE::CDirectory::Create(fileName);
-- 
1.7.10.msysgit.1

