[SCM] libav/experimental: Add support for ogg text subtitles.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:12:47 UTC 2013


The following commit has been merged in the experimental branch:
commit 2331e31c233b1b9ce6d626827342ffd70039c619
Author: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
Date:   Thu Jan 31 22:30:55 2008 +0000

    Add support for ogg text subtitles.
    
    Originally committed as revision 11698 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 8e90137..5b67291 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -44,6 +44,7 @@ static ogg_codec_t *ogg_codecs[] = {
     &old_flac_codec,
     &ogm_video_codec,
     &ogm_audio_codec,
+    &ogm_text_codec,
     &ogm_old_codec,
     NULL
 };
diff --git a/libavformat/oggdec.h b/libavformat/oggdec.h
index 964c044..66af84c 100644
--- a/libavformat/oggdec.h
+++ b/libavformat/oggdec.h
@@ -81,6 +81,7 @@ extern ogg_codec_t flac_codec;
 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);
diff --git a/libavformat/oggparseogm.c b/libavformat/oggparseogm.c
index bbf9cb8..597a3c6 100644
--- a/libavformat/oggparseogm.c
+++ b/libavformat/oggparseogm.c
@@ -55,6 +55,10 @@ ogm_header(AVFormatContext *s, int idx)
         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 @@ ogg_codec_t ogm_audio_codec = {
     .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,

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list