Mercurial > mplayer.hg
changeset 3724:a2325883c46c
vplayer format - no longer crashes on slightly broken subs.
author | eyck |
---|---|
date | Tue, 25 Dec 2001 01:32:04 +0000 |
parents | c8a267dc9941 |
children | ba98028ddc27 |
files | subreader.c |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/subreader.c Tue Dec 25 01:18:59 2001 +0000 +++ b/subreader.c Tue Dec 25 01:32:04 2001 +0000 @@ -253,17 +253,17 @@ char line[LINE_LEN+1]; char line2[LINE_LEN+1]; int a1,a2,a3,b1,b2,b3; - char *p=NULL, *next; + char *p=NULL, *next,*separator; int i,len,len2,plen; memset(current, '\0', sizeof(subtitle)); while (!current->text[0]) { if (!fgets (line, LINE_LEN, fd)) return NULL; - if ((len=sscanf (line, "%d:%d:%d:%n",&a1,&a2,&a3,&plen)) < 3) + if ((len=sscanf (line, "%d:%d:%d%c%n",&a1,&a2,&a3,&separator,&plen)) < 4) continue; if (!fgets (line2, LINE_LEN, fd)) return NULL; - if ((len2=sscanf (line2, "%d:%d:%d:",&b1,&b2,&b3)) < 3) + if ((len2=sscanf (line2, "%d:%d:%d%c",&b1,&b2,&b3,&separator)) < 3) continue; // przewiń o linijkę do tyłu: fseek(fd,-strlen(line2),SEEK_CUR);