From 2626cc4580bfd560c6983338d77b2c11c16af94f Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Sat, 11 Aug 2012 20:29:20 -0700 Subject: matroska: Mark S_TEXT/UTF-8 as Subrip encoded subtitles. While not explicitly stated in the specs, the original author has stated that S_TEXT/UTF-8 is expected to be text using Subrip markup, but without Subrip in-band timing. So, now that we have a decoder that conforms to this expectation, let's use it. Note that this change will impact tools that use libavformat. If they expect srt subtitles to have CODEC_ID_TEXT, they must be adjusted to expect CODEC_ID_SUBRIP. The actual content is, obviously, unchanged. Signed-off-by: Philip Langdale --- libavformat/matroska.c | 1 + libavformat/matroskadec.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'libavformat') diff --git a/libavformat/matroska.c b/libavformat/matroska.c index b386d74..b016491 100644 --- a/libavformat/matroska.c +++ b/libavformat/matroska.c @@ -53,6 +53,7 @@ const CodecTags ff_mkv_codec_tags[]={ {"A_VORBIS" , AV_CODEC_ID_VORBIS}, {"A_WAVPACK4" , AV_CODEC_ID_WAVPACK}, + {"S_TEXT/UTF8" , AV_CODEC_ID_SUBRIP}, {"S_TEXT/UTF8" , AV_CODEC_ID_TEXT}, {"S_TEXT/UTF8" , AV_CODEC_ID_SRT}, {"S_TEXT/ASCII" , AV_CODEC_ID_TEXT}, diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 41375e3..1d0dbb3 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -2105,7 +2105,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, else pkt->pts = timecode; pkt->pos = pos; - if (st->codec->codec_id == AV_CODEC_ID_TEXT) + if (st->codec->codec_id == AV_CODEC_ID_SUBRIP) pkt->convergence_duration = lace_duration; else if (track->type != MATROSKA_TRACK_TYPE_SUBTITLE) pkt->duration = lace_duration; -- cgit v1.1