Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2014
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. diff --git a/libavformat/stldec.c b/libavformat/stldec.c
  2. index 24ae5bd..62597e5 100644
  3. --- a/libavformat/stldec.c
  4. +++ b/libavformat/stldec.c
  5. @@ -10,9 +10,9 @@ typedef struct {
  6.  
  7. static int stl_probe(AVProbeData *p)
  8. {
  9. - char c;
  10. +
  11. const unsigned char *ptr = p->buf;
  12. - if (sscanf(ptr, "%*d:%*d:%*d:%*d , %*d:%*d:%*d:%*d ,", &c) == 1)
  13. + if (sscanf(ptr, "%*d:%*d:%*d:%*d , %*d:%*d:%*d:%*d ,") == 1)
  14. return AVPROBE_SCORE_MAX;
  15. return 0;
  16. }
  17. @@ -21,20 +21,22 @@ static int64_t get_pts(const char **buf, int *duration,
  18. {
  19. int hh1, mm1, ss1, ms1;
  20. int hh2, mm2, ss2, ms2;
  21. - if (sscanf(*buf, "%2d:%2d:%2d:%2d , %2d:%2d:%2d:%2d , ",
  22. + char c;
  23. + if (sscanf(*buf, "%2d:%2d:%2d:%2d , %2d:%2d:%2d:%2d , %*c",
  24. &hh1, &mm1, &ss1, &ms1,
  25. - &hh2, &mm2, &ss2, &ms2) >= 6) {
  26. + &hh2, &mm2, &ss2, &ms2, &c) >= 6) {
  27. +
  28. int64_t start = (hh1*3600LL + mm1*60LL + ss1) * 100LL + ms1;
  29. int64_t end = (hh2*3600LL + mm2*60LL + ss2) * 100LL + ms2;
  30. *duration = end - start;
  31. - *buf += ff_subtitles_next_line(*buf);
  32. return start;
  33. - }
  34. - *buf += ff_subtitles_next_line(*buf);
  35. -
  36. - return AV_NOPTS_VALUE;
  37. + }
  38. + return AV_NOPTS_VALUE;
  39. +
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement