[FFmpeg-devel] [PATCH] support text subtitles in ogm

Reimar Döffinger Reimar.Doeffinger
Thu Jan 31 22:49:22 CET 2008


Hello,
almost a trivial patch.
Sample:
http://samples.mplayerhq.hu/ogg/bgc.sub.dub.ogm
Ok to apply?

Greetings,
Reimar D?ffinger
-------------- next part --------------
Index: oggparseogm.c
===================================================================
--- oggparseogm.c	(revision 11697)
+++ oggparseogm.c	(working copy)
@@ -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 = 6,
+    .header = ogm_header,
+    .packet = ogm_packet
+};
+
 ogg_codec_t ogm_old_codec = {
     .magic = "\001Direct Show Samples embedded in Ogg",
     .magicsize = 35,
Index: oggdec.c
===================================================================
--- oggdec.c	(revision 11697)
+++ oggdec.c	(working copy)
@@ -44,6 +44,7 @@
     &old_flac_codec,
     &ogm_video_codec,
     &ogm_audio_codec,
+    &ogm_text_codec,
     &ogm_old_codec,
     NULL
 };
Index: oggdec.h
===================================================================
--- oggdec.h	(revision 11697)
+++ oggdec.h	(working copy)
@@ -81,6 +81,7 @@
 extern ogg_codec_t old_flac_codec;
 extern ogg_codec_t ogm_video_codec;
 extern ogg_codec_t ogm_audio_codec;
+extern ogg_codec_t ogm_text_codec;
 extern ogg_codec_t ogm_old_codec;
 
 extern int vorbis_comment(AVFormatContext *ms, uint8_t *buf, int size);



More information about the ffmpeg-devel mailing list