Advertisement
Guest User

Untitled

a guest
Nov 16th, 2015
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.22 KB | None | 0 0
  1. From 8247178288d884d18d7d1d0374fded85995a1168 Mon Sep 17 00:00:00 2001
  2. From: Hendrik Leppkes <h.leppkes@gmail.com>
  3. Date: Tue, 17 Nov 2015 00:05:32 +0100
  4. Subject: [PATCH] avformat/mlpdec: consider all valid mlp access units when
  5.  probing
  6.  
  7. ---
  8. libavformat/mlpdec.c | 5 ++++-
  9.  1 file changed, 4 insertions(+), 1 deletion(-)
  10.  
  11. diff --git a/libavformat/mlpdec.c b/libavformat/mlpdec.c
  12. index 2cce506..d82df21 100644
  13. --- a/libavformat/mlpdec.c
  14. +++ b/libavformat/mlpdec.c
  15. @@ -29,16 +29,19 @@ static int av_always_inline mlp_thd_probe(AVProbeData *p, uint32_t sync)
  16.  {
  17.      const uint8_t *buf, *last_buf = p->buf, *end = p->buf + p->buf_size;
  18.      int frames = 0, valid = 0, size = 0;
  19. +    int nsubframes = 0;
  20.  
  21.      for (buf = p->buf; buf + 8 <= end; buf++) {
  22.          if (AV_RB32(buf + 4) == sync) {
  23.              frames++;
  24.              if (last_buf + size == buf) {
  25. -                valid++;
  26. +                valid += 1 + nsubframes / 8;
  27.              }
  28. +            nsubframes = 0;
  29.              last_buf = buf;
  30.              size = (AV_RB16(buf) & 0xfff) * 2;
  31.          } else if (buf - last_buf == size) {
  32. +            nsubframes++;
  33.              size += (AV_RB16(buf) & 0xfff) * 2;
  34.          }
  35.      }
  36. --
  37. 2.6.2.windows.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement