summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
authormplayer-svn <svn@mplayerhq.hu>2011-08-15 20:19:39 +0000
committerwm4 <wm4@nowhere>2012-08-03 01:26:22 +0200
commit335c6259d2f2460e9a0e4d7fbc885cab2d70b114 (patch)
tree5eb9e5c200ddbfe500690185a202aca7afb6ff57 /sub
parentc5b0ec92f9016c8a59f7146b53a9839f97fe8bd2 (diff)
downloadmpv-335c6259d2f2460e9a0e4d7fbc885cab2d70b114.tar.bz2
mpv-335c6259d2f2460e9a0e4d7fbc885cab2d70b114.tar.xz
subreader: fix reading of aqr/subrip09 subtitles
NULL return would indicate EOF, thus the "clear subtitle" entries would cause sub file parsing to stop. In addition the wrong sub end times would be used with CONFIG_SORTSUB. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33993 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
Diffstat (limited to 'sub')
-rw-r--r--sub/subreader.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sub/subreader.c b/sub/subreader.c
index 18b2e53bf7..275c8abba9 100644
--- a/sub/subreader.c
+++ b/sub/subreader.c
@@ -820,6 +820,7 @@ static subtitle *sub_read_line_aqt(stream_t *st,subtitle *current,
int utf16 = args->utf16;
char line[LINE_LEN+1];
+retry:
while (1) {
// try to locate next subtitle
if (!stream_read_line (st, line, LINE_LEN, utf16))
@@ -829,6 +830,7 @@ static subtitle *sub_read_line_aqt(stream_t *st,subtitle *current,
}
#ifdef CONFIG_SORTSUB
+ if (!previous_sub_end)
previous_sub_end = (current->start) ? current->start - 1 : 0;
#else
if (previous_aqt_sub != NULL)
@@ -851,13 +853,11 @@ static subtitle *sub_read_line_aqt(stream_t *st,subtitle *current,
return ERR;
if (!strlen(current->text[0]) && !strlen(current->text[1])) {
-#ifdef CONFIG_SORTSUB
- previous_sub_end = 0;
-#else
+#ifndef CONFIG_SORTSUB
// void subtitle -> end of previous marked and exit
previous_aqt_sub = NULL;
#endif
- return NULL;
+ goto retry;
}
return current;
@@ -875,6 +875,7 @@ static subtitle *sub_read_line_subrip09(stream_t *st,subtitle *current,
int a1,a2,a3;
int len;
+retry:
while (1) {
// try to locate next subtitle
if (!stream_read_line (st, line, LINE_LEN, utf16))
@@ -886,6 +887,7 @@ static subtitle *sub_read_line_subrip09(stream_t *st,subtitle *current,
current->start = a1*360000+a2*6000+a3*100;
#ifdef CONFIG_SORTSUB
+ if (!previous_sub_end)
previous_sub_end = (current->start) ? current->start - 1 : 0;
#else
if (previous_subrip09_sub != NULL)
@@ -903,13 +905,11 @@ static subtitle *sub_read_line_subrip09(stream_t *st,subtitle *current,
return ERR;
if (!strlen(current->text[0]) && current->lines <= 1) {
-#ifdef CONFIG_SORTSUB
- previous_sub_end = 0;
-#else
+#ifndef CONFIG_SORTSUB
// void subtitle -> end of previous marked and exit
previous_subrip09_sub = NULL;
#endif
- return NULL;
+ goto retry;
}
return current;