From 7dfc1fdea27b3378b929188f2cd6b5b650c14671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Sat, 26 Jan 2008 21:21:55 +0000 Subject: [PATCH] Extract the pure plaintext from mov text subtitles. Formatting information etc. is discarded. Originally committed as revision 11625 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/mov.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavformat/mov.c b/libavformat/mov.c index 7542a01adc..6080f7d5c4 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1542,6 +1542,12 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) } else { #endif av_get_packet(s->pb, pkt, sample->size); + if (s->streams[sc->ffindex]->codec->codec_id == CODEC_ID_TEXT) { + int textlen = FFMIN(AV_RB16(pkt->data), sample->size - 2); + textlen = FFMAX(textlen, 0); + memmove(pkt->data, pkt->data + 2, textlen); + pkt->size = textlen; + } #ifdef CONFIG_DV_DEMUXER if (mov->dv_demux) { void *pkt_destruct_func = pkt->destruct;