Browse Source

libavformat/mtv: donwgrade probe score for < 512

MTV has a 512 bytes header. We should be able to
parse required fiels from the first 57 (rest is
padding) but if we haven't seen enough data then
go with SCORE_EXTENSION.

Signed-off-by: Reynaldo H. Verdejo Pinochet <r.verdejo@sisa.samsung.com>
tags/n2.2-rc1
Reynaldo H. Verdejo Pinochet 11 years ago
parent
commit
d467e7df1a
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      libavformat/mtv.c

+ 7
- 0
libavformat/mtv.c View File

@@ -78,6 +78,13 @@ static int mtv_probe(AVProbeData *p)
if(p->buf[51] != 16)
return AVPROBE_SCORE_EXTENSION / 2; // But we are going to assume 16bpp anyway ..

/* We had enough data to parse header values
* but we expect to be able to get 512 bytes
* of header to be sure.
*/
if (p->buf_size < MTV_HEADER_SIZE)
return AVPROBE_SCORE_EXTENSION;

return AVPROBE_SCORE_MAX;
}



Loading…
Cancel
Save