[FFmpeg-devel] [PATCH 13/21] libavformat/mov: basic support for identifying (and reading) timed metadata

erkki.seppala.ext at nokia.com erkki.seppala.ext at nokia.com
Tue Aug 23 12:03:31 EEST 2016


From: Erkki Seppälä <erkki.seppala.ext at nokia.com>

mov_codec_id is now able to set AVMEDIA_TYPE_DATA to the
st->codec->codec_type field when the input is of type
AVMEDIA_TYPE_DATA; previously it used AVMEDIA_TYPE_SUBTITLE as the
value to set in that case.

Signed-off-by: Erkki Seppälä <erkki.seppala.ext at nokia.com>
Signed-off-by: OZOPlayer <OZOPL at nokia.com>
---
 libavformat/mov.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 9cd915d..f18c0a3 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1789,12 +1789,20 @@ static int mov_codec_id(AVStream *st, uint32_t format)
             id = ff_codec_get_id(ff_codec_bmp_tags, format);
         if (id > 0)
             st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
-        else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA ||
-                    (st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE &&
-                    st->codecpar->codec_id == AV_CODEC_ID_NONE)) {
-            id = ff_codec_get_id(ff_codec_movsubtitle_tags, format);
-            if (id > 0)
-                st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
+        else {
+            if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA ||
+                (st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE &&
+                 st->codecpar->codec_id == AV_CODEC_ID_NONE)) {
+                id = ff_codec_get_id(ff_codec_movsubtitle_tags, format);
+                if (id > 0)
+                    st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
+            }
+            if (id <= 0 &&
+                st->codecpar->codec_type == AVMEDIA_TYPE_DATA) {
+                id = ff_codec_get_id(ff_codec_metadata_tags, format);
+                if (id > 0)
+                    st->codecpar->codec_type = AVMEDIA_TYPE_DATA;
+            }
         }
     }
 
-- 
2.7.4



More information about the ffmpeg-devel mailing list