changeset 2365:76827ffd1cf6 libavformat

flac probe closes issue83
author michael
date Fri, 10 Aug 2007 16:06:18 +0000
parents 7c31128b23f8
children ddc8034208a5
files raw.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/raw.c	Fri Aug 10 15:37:55 2007 +0000
+++ b/raw.c	Fri Aug 10 16:06:18 2007 +0000
@@ -434,6 +434,12 @@
     else                   return 0;
 }
 
+static int flac_probe(AVProbeData *p)
+{
+    if(memcmp(p->buf, "fLaC", 4)) return 0;
+    else                          AVPROBE_SCORE_MAX / 2;
+}
+
 AVInputFormat shorten_demuxer = {
     "shn",
     "raw shorten",
@@ -450,7 +456,7 @@
     "flac",
     "raw flac",
     0,
-    NULL,
+    flac_probe,
     flac_read_header,
     raw_read_partial_packet,
     raw_read_close,