changeset 21032:ddc587b1fd8b

Support multiple subs in mov
author reimar
date Sun, 19 Nov 2006 11:55:03 +0000
parents e45bb0ee5558
children 087cad309e9c
files libmpdemux/demux_mov.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mov.c	Sun Nov 19 11:21:09 2006 +0000
+++ b/libmpdemux/demux_mov.c	Sun Nov 19 11:55:03 2006 +0000
@@ -2175,6 +2175,8 @@
         if (sh->type == 'v')
           ds_read_packet(demuxer->sub, demuxer->stream, len, subpts, pos, 0);
         else {
+          int i;
+          char *line = priv->subtext;
           stream_skip(demuxer->stream, 2); // size
           len -= 2;
           if (len < 0) len = 0;
@@ -2183,6 +2185,11 @@
           priv->subtext[len] = 0;
           priv->subs.lines = 1;
           priv->subs.text[0] = &priv->subtext;
+          while ((line = strchr(line, '\n'))) {
+            *line++ = 0;
+            priv->subs.text[priv->subs.lines] = line;
+            priv->subs.lines++;
+          }
           vo_sub = &priv->subs;
         }
         priv->current_sub = samplenr;