aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2005-12-05 00:15:51 +0000
committerMåns Rullgård <mans@mansr.com>2005-12-05 00:15:51 +0000
commit2e70e4aa570d02cc9d32a775ba9accdff3901181 (patch)
tree0c12e3288a4b25450a3df2a6f2f31b6eebaee96d
parent4393e6392c123142eb248d62d4109fb422ce99e3 (diff)
downloadffmpeg-2e70e4aa570d02cc9d32a775ba9accdff3901181.tar.gz
ogg format probe function by Ivo <ivop at euronet nl>
Originally committed as revision 4719 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/ogg2.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libavformat/ogg2.c b/libavformat/ogg2.c
index e6da34e816..8e00946826 100644
--- a/libavformat/ogg2.c
+++ b/libavformat/ogg2.c
@@ -622,11 +622,23 @@ ogg_read_timestamp (AVFormatContext * s, int stream_index, int64_t * pos_arg,
}
#endif
+static int ogg_probe(AVProbeData *p)
+{
+ if (p->buf_size < 6)
+ return 0;
+ if (p->buf[0] == 'O' && p->buf[1] == 'g' &&
+ p->buf[2] == 'g' && p->buf[3] == 'S' &&
+ p->buf[4] == 0x0 && p->buf[5] <= 0x7 )
+ return AVPROBE_SCORE_MAX;
+ else
+ return 0;
+}
+
static AVInputFormat ogg_iformat = {
"ogg",
"Ogg",
sizeof (ogg_t),
- NULL,
+ ogg_probe,
ogg_read_header,
ogg_read_packet,
ogg_read_close,