aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/avienc.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-06-19 13:26:10 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-06-19 13:26:10 +0000
commit2a04d6e7726d5397913544180196c8c06784aea6 (patch)
tree8ea446c4cb9851417aca89db3ffa449cec604b52 /libavformat/avienc.c
parenta4276ba2ac473f24087474e8ab6c94c06f6f7e14 (diff)
downloadffmpeg-2a04d6e7726d5397913544180196c8c06784aea6.tar.gz
Add support for muxing XSUB subtitles to AVI muxer.
Originally committed as revision 19223 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avienc.c')
-rw-r--r--libavformat/avienc.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libavformat/avienc.c b/libavformat/avienc.c
index 3fd98692ab..c70b0abd73 100644
--- a/libavformat/avienc.c
+++ b/libavformat/avienc.c
@@ -81,6 +81,10 @@ static char* avi_stream2fourcc(char* tag, int index, enum CodecType type)
if (type == CODEC_TYPE_VIDEO) {
tag[2] = 'd';
tag[3] = 'c';
+ } else if (type == CODEC_TYPE_SUBTITLE) {
+ // note: this is not an official code
+ tag[2] = 's';
+ tag[3] = 'b';
} else {
tag[2] = 'w';
tag[3] = 'b';
@@ -208,12 +212,17 @@ static int avi_write_header(AVFormatContext *s)
/* stream generic header */
strh = start_tag(pb, "strh");
switch(stream->codec_type) {
+ case CODEC_TYPE_SUBTITLE:
+ // XSUB subtitles behave like video tracks, other subtitles
+ // are not (yet) supported.
+ if (stream->codec_id != CODEC_ID_XSUB) break;
case CODEC_TYPE_VIDEO: put_tag(pb, "vids"); break;
case CODEC_TYPE_AUDIO: put_tag(pb, "auds"); break;
// case CODEC_TYPE_TEXT : put_tag(pb, "txts"); break;
case CODEC_TYPE_DATA : put_tag(pb, "dats"); break;
}
- if(stream->codec_type == CODEC_TYPE_VIDEO)
+ if(stream->codec_type == CODEC_TYPE_VIDEO ||
+ stream->codec_id == CODEC_ID_XSUB)
put_le32(pb, stream->codec_tag);
else
put_le32(pb, 1);
@@ -252,6 +261,10 @@ static int avi_write_header(AVFormatContext *s)
if(stream->codec_type != CODEC_TYPE_DATA){
strf = start_tag(pb, "strf");
switch(stream->codec_type) {
+ case CODEC_TYPE_SUBTITLE:
+ // XSUB subtitles behave like video tracks, other subtitles
+ // are not (yet) supported.
+ if (stream->codec_id != CODEC_ID_XSUB) break;
case CODEC_TYPE_VIDEO:
put_bmp_header(pb, stream, codec_bmp_tags, 0);
break;