changeset 2970:ed7e36770ee5 libavformat

Extract the pure plaintext from mov text subtitles. Formatting information etc. is discarded.
author reimar
date Sat, 26 Jan 2008 21:21:55 +0000
parents f3a3115a96e4
children 45ffd9c8b23a
files mov.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mov.c	Sat Jan 26 20:30:03 2008 +0000
+++ b/mov.c	Sat Jan 26 21:21:55 2008 +0000
@@ -1542,6 +1542,12 @@
     } 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;