Advertisement
Guest User

Untitled

a guest
Sep 30th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include "avformat.h"
  2. #include "internal.h"
  3. #include "subtitles.h"
  4.  
  5.  
  6. typedef struct {
  7. FFDemuxSubtitlesQueue q;
  8. } STLContext;
  9.  
  10. static int stl_probe(AVProbeData *p)
  11. {
  12. char buf[64], *pbuf;
  13. FFTextReader tr;
  14.  
  15. ff_text_init_buf(&tr, p->buf, p->buf_size);
  16. /*Moving to next line in case of a command or new line or carriage return */
  17. while (ff_text_peek_r8(&tr) == '\r' || ff_text_peek_r8(&tr) == '\n' || ff_text_peek_r8(&tr) == '$')
  18. ff_text_r8(&tr);
  19.  
  20. /* Checking if the next line matches a STL timestamp */
  21. if (ff_subtitles_read_line(&tr, buf, sizeof(buf)) < 0)
  22. return 0;
  23. if (sscanf(buf, "%*d:%*2d:%*2d:%*2d , %*d:%*2d:%*2d%*2d ,", &v) == 1)
  24. return AVPROBE_SCORE_MAX;
  25.  
  26. return 0;
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement