diff oggparseogm.c @ 2994:35b3eaafd9fe libavformat

Add support for ogg text subtitles.
author reimar
date Thu, 31 Jan 2008 22:30:55 +0000
parents 2b101e9d25c0
children c3de842d7ff5
line wrap: on
line diff
--- a/oggparseogm.c	Thu Jan 31 13:40:53 2008 +0000
+++ b/oggparseogm.c	Thu Jan 31 22:30:55 2008 +0000
@@ -55,6 +55,10 @@
         tag = bytestream_get_le32(&p);
         st->codec->codec_id = codec_get_id(codec_bmp_tags, tag);
         st->codec->codec_tag = tag;
+    } else if (*p == 't') {
+        st->codec->codec_type = CODEC_TYPE_SUBTITLE;
+        st->codec->codec_id = CODEC_ID_TEXT;
+        p += 12;
     } else {
         uint8_t acid[5];
         int cid;
@@ -158,6 +162,13 @@
     .packet = ogm_packet
 };
 
+ogg_codec_t ogm_text_codec = {
+    .magic = "\001text",
+    .magicsize = 5,
+    .header = ogm_header,
+    .packet = ogm_packet
+};
+
 ogg_codec_t ogm_old_codec = {
     .magic = "\001Direct Show Samples embedded in Ogg",
     .magicsize = 35,