Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/libavformat/stldec.c b/libavformat/stldec.c
- index 24ae5bd..62597e5 100644
- --- a/libavformat/stldec.c
- +++ b/libavformat/stldec.c
- @@ -10,9 +10,9 @@ typedef struct {
- static int stl_probe(AVProbeData *p)
- {
- - char c;
- +
- const unsigned char *ptr = p->buf;
- - if (sscanf(ptr, "%*d:%*d:%*d:%*d , %*d:%*d:%*d:%*d ,", &c) == 1)
- + if (sscanf(ptr, "%*d:%*d:%*d:%*d , %*d:%*d:%*d:%*d ,") == 1)
- return AVPROBE_SCORE_MAX;
- return 0;
- }
- @@ -21,20 +21,22 @@ static int64_t get_pts(const char **buf, int *duration,
- {
- int hh1, mm1, ss1, ms1;
- int hh2, mm2, ss2, ms2;
- - if (sscanf(*buf, "%2d:%2d:%2d:%2d , %2d:%2d:%2d:%2d , ",
- + char c;
- + if (sscanf(*buf, "%2d:%2d:%2d:%2d , %2d:%2d:%2d:%2d , %*c",
- &hh1, &mm1, &ss1, &ms1,
- - &hh2, &mm2, &ss2, &ms2) >= 6) {
- + &hh2, &mm2, &ss2, &ms2, &c) >= 6) {
- +
- int64_t start = (hh1*3600LL + mm1*60LL + ss1) * 100LL + ms1;
- int64_t end = (hh2*3600LL + mm2*60LL + ss2) * 100LL + ms2;
- *duration = end - start;
- - *buf += ff_subtitles_next_line(*buf);
- return start;
- - }
- - *buf += ff_subtitles_next_line(*buf);
- -
- - return AV_NOPTS_VALUE;
- + }
- + return AV_NOPTS_VALUE;
- +
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement