Mercurial > libavformat.hg
changeset 877:7e42b4e47dfc libavformat
ogg format probe function by Ivo <ivop at euronet nl>
author | mru |
---|---|
date | Mon, 05 Dec 2005 00:15:51 +0000 |
parents | 476666be9b89 |
children | 8782b02914e3 |
files | ogg2.c |
diffstat | 1 files changed, 13 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ogg2.c Wed Nov 30 10:50:13 2005 +0000 +++ b/ogg2.c Mon Dec 05 00:15:51 2005 +0000 @@ -622,11 +622,23 @@ } #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,