diff options
author | eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-01-18 14:50:32 +0000 |
---|---|---|
committer | eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-01-18 14:50:32 +0000 |
commit | dd276fa5ef132e08672ba2438d325634cfb063fe (patch) | |
tree | 40da6090e6900ed9a0eae7d3700d98b56ac3155f /subreader.c | |
parent | fa1c3630e33da0435a17de630bc29be076fdf496 (diff) | |
download | mpv-dd276fa5ef132e08672ba2438d325634cfb063fe.tar.bz2 mpv-dd276fa5ef132e08672ba2438d325634cfb063fe.tar.xz |
In .srt, any line containing only spaces and tabs marks the end of the
current subtitle.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21957 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'subreader.c')
-rw-r--r-- | subreader.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/subreader.c b/subreader.c index 511356a3a1..91d3707bc3 100644 --- a/subreader.c +++ b/subreader.c @@ -355,10 +355,13 @@ static subtitle *sub_read_line_subviewer(stream_t *st,subtitle *current) { current->start = a1*360000+a2*6000+a3*100+a4/10; current->end = b1*360000+b2*6000+b3*100+b4/10; for (i=0; i<SUB_MAX_TEXT;) { + int blank = 1; if (!stream_read_line (st, line, LINE_LEN)) break; len=0; - for (p=line; *p!='\n' && *p!='\r' && *p; p++,len++); - if (len) { + for (p=line; *p!='\n' && *p!='\r' && *p; p++,len++) + if (*p != ' ' && *p != '\t') + blank = 0; + if (len && !blank) { int j=0,skip=0; char *curptr=current->text[i]=malloc (len+1); if (!current->text[i]) return ERR; |