git.videolan.org
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7d7b4e8
)
avformat/srtdec: skip initial random line breaks.
author
Clément Bœsch
<u@pkh.me>
Sun, 8 Sep 2013 14:17:46 +0000
(16:17 +0200)
committer
Clément Bœsch
<u@pkh.me>
Sun, 8 Sep 2013 16:37:07 +0000
(18:37 +0200)
I found a bunch of (recent) SRT files in the wild with 3 to 10 line
breaks at the beginning.
libavformat/srtdec.c
patch
|
blob
|
history
diff --git
a/libavformat/srtdec.c
b/libavformat/srtdec.c
index
dbf1866
..
ac783d9
100644
(file)
--- a/
libavformat/srtdec.c
+++ b/
libavformat/srtdec.c
@@
-37,6
+37,8
@@
static int srt_probe(AVProbeData *p)
if (AV_RB24(ptr) == 0xEFBBBF)
ptr += 3; /* skip UTF-8 BOM */
+ while (*ptr == '\r' || *ptr == '\n')
+ ptr++;
for (i=0; i<2; i++) {
if ((num == i || num + 1 == i)
&& sscanf(ptr, "%*d:%*2d:%*2d%*1[,.]%*3d --> %*d:%*2d:%*2d%*1[,.]%3d", &v) == 1)