summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-06-19 22:13:29 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-06-19 22:13:35 +0200
commit37baeccef4e54105c0a4bf20bee6de81989f8a07 (patch)
tree74278585af698675e954d927951d4511540a6334
parentb08cd2fb944d7ec4a9a07aa9d66f0a7d1b8df776 (diff)
parent06bede95fcea47d2e51e8ff248c15311f335b898 (diff)
Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master: Autodetect idcin only if audio properties allow decoding. Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/idcin.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/idcin.c b/libavformat/idcin.c
index a4085a9466..31d34f38fc 100644
--- a/libavformat/idcin.c
+++ b/libavformat/idcin.c
@@ -93,7 +93,7 @@ typedef struct IdcinDemuxContext {
static int idcin_probe(AVProbeData *p)
{
- unsigned int number;
+ unsigned int number, sample_rate;
/*
* This is what you could call a "probabilistic" file check: id CIN
@@ -122,18 +122,18 @@ static int idcin_probe(AVProbeData *p)
return 0;
/* check the audio sample rate */
- number = AV_RL32(&p->buf[8]);
- if ((number != 0) && ((number < 8000) | (number > 48000)))
+ sample_rate = AV_RL32(&p->buf[8]);
+ if (sample_rate && (sample_rate < 8000 || sample_rate > 48000))
return 0;
/* check the audio bytes/sample */
number = AV_RL32(&p->buf[12]);
- if (number > 2)
+ if (number > 2 || sample_rate && !number)
return 0;
/* check the audio channels */
number = AV_RL32(&p->buf[16]);
- if (number > 2)
+ if (number > 2 || sample_rate && !number)
return 0;
/* return half certainty since this check is a bit sketchy */