summaryrefslogtreecommitdiff
path: root/ffmpeg/libavformat/srtdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'ffmpeg/libavformat/srtdec.c')
-rw-r--r--ffmpeg/libavformat/srtdec.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ffmpeg/libavformat/srtdec.c b/ffmpeg/libavformat/srtdec.c
index 76e06e4..7f911bd 100644
--- a/ffmpeg/libavformat/srtdec.c
+++ b/ffmpeg/libavformat/srtdec.c
@@ -37,12 +37,14 @@ 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)
return AVPROBE_SCORE_MAX;
num = atoi(ptr);
- ptr += strcspn(ptr, "\n") + 1;
+ ptr += ff_subtitles_next_line(ptr);
}
return 0;
}
@@ -63,10 +65,10 @@ static int64_t get_pts(const char **buf, int *duration,
int64_t start = (hh1*3600LL + mm1*60LL + ss1) * 1000LL + ms1;
int64_t end = (hh2*3600LL + mm2*60LL + ss2) * 1000LL + ms2;
*duration = end - start;
- *buf += strcspn(*buf, "\n") + 1;
+ *buf += ff_subtitles_next_line(*buf);
return start;
}
- *buf += strcspn(*buf, "\n") + 1;
+ *buf += ff_subtitles_next_line(*buf);
}
return AV_NOPTS_VALUE;
}