aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2008-01-26 21:21:55 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2008-01-26 21:21:55 +0000
commit7dfc1fdea27b3378b929188f2cd6b5b650c14671 (patch)
tree2115eee00df219d9aa8cd9aad81b3a2f8272a9be
parent1e3c9307e628063811a9c8a0417854a6f73f8252 (diff)
downloadffmpeg-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.c6
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;