[FFmpeg-devel] [PATCH]Autodetect raw flac files

Carl Eugen Hoyos cehoyos at ag.or.at
Thu Apr 9 13:21:32 CEST 2015


Hi!

Attached patch allows to autodetect headerless flac files.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c
index 1a8dc19..60551d0 100644
--- a/libavformat/flacdec.c
+++ b/libavformat/flacdec.c
@@ -178,6 +178,8 @@ fail:
 
 static int flac_probe(AVProbeData *p)
 {
+    if ((AV_RB16(p->buf) & 0xFFFE) == 0xFFF8 && p->buf[2] & 0xF0 && p->buf[2] ^ 0x0F)
+        return AVPROBE_SCORE_EXTENSION / 4;
     if (p->buf_size < 4 || memcmp(p->buf, "fLaC", 4))
         return 0;
     return AVPROBE_SCORE_EXTENSION;


More information about the ffmpeg-devel mailing list