diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2008-01-26 21:21:55 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2008-01-26 21:21:55 +0000 |
commit | 7dfc1fdea27b3378b929188f2cd6b5b650c14671 (patch) | |
tree | 2115eee00df219d9aa8cd9aad81b3a2f8272a9be | |
parent | 1e3c9307e628063811a9c8a0417854a6f73f8252 (diff) | |
download | ffmpeg-7dfc1fdea27b3378b929188f2cd6b5b650c14671.tar.gz |
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
-rw-r--r-- | libavformat/mov.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; |