mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 00:32:31 +00:00
bit: rewrite probe
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
21922dc5ae
commit
dfc571ff18
@ -10,19 +10,17 @@
|
|||||||
|
|
||||||
static int probe(AVProbeData *p)
|
static int probe(AVProbeData *p)
|
||||||
{
|
{
|
||||||
int i;
|
int i, j;
|
||||||
i=AV_RL16(&p->buf[0]);
|
|
||||||
if(i != SYNC_WORD)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
switch(AV_RL16(&p->buf[2]))
|
for(i=0; i+3<p->buf_size && i< 10*0x50; ){
|
||||||
{
|
if(AV_RL16(&p->buf[0]) != SYNC_WORD)
|
||||||
case 0x40:
|
return 0;
|
||||||
case 0x50:
|
j=AV_RL16(&p->buf[2]);
|
||||||
return AVPROBE_SCORE_MAX/2;
|
if(j!=0x40 && j!=0x50)
|
||||||
default:
|
return 0;
|
||||||
return 0;
|
i+=j;
|
||||||
}
|
}
|
||||||
|
return AVPROBE_SCORE_MAX/2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int read_header(AVFormatContext *s, AVFormatParameters *ap)
|
static int read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||||
|
Loading…
Reference in New Issue
Block a user