]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/raw.c
Add a read_timestamp function to ogg demuxer
[ffmpeg] / libavformat / raw.c
index e03fad5e1e7b115ff88283d2b932fd1fc4435ca8..bd9380315ca6b54b1234a48967a8c8ec2fa31fdc 100644 (file)
@@ -21,6 +21,7 @@
  */
 #include "avformat.h"
 #include "ac3_parser.h"
+#include "raw.h"
 
 #ifdef CONFIG_MUXERS
 /* simple formats */
@@ -409,9 +410,6 @@ static int ac3_probe(AVProbeData *p)
     uint8_t *buf, *buf2, *end;
     AC3HeaderInfo hdr;
 
-    if(p->buf_size < 7)
-        return 0;
-
     max_frames = 0;
     buf = p->buf;
     end = buf + p->buf_size;
@@ -434,6 +432,12 @@ static int ac3_probe(AVProbeData *p)
     else                   return 0;
 }
 
+static int flac_probe(AVProbeData *p)
+{
+    if(memcmp(p->buf, "fLaC", 4)) return 0;
+    else                          return AVPROBE_SCORE_MAX / 2;
+}
+
 AVInputFormat shorten_demuxer = {
     "shn",
     "raw shorten",
@@ -450,7 +454,7 @@ AVInputFormat flac_demuxer = {
     "flac",
     "raw flac",
     0,
-    NULL,
+    flac_probe,
     flac_read_header,
     raw_read_partial_packet,
     raw_read_close,