aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2013-06-19 16:31:10 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2013-06-19 23:47:43 +0200
commit3d4a61fbda65ebdd00b049166eaedccfbe9ff6ba (patch)
tree60272363faaf46179934ae258f9fc16f9383bf81
parentd5b068d44b4bf42951611a92d3697786564ef002 (diff)
downloadffmpeg-3d4a61fbda65ebdd00b049166eaedccfbe9ff6ba.tar.gz
Autodetect idcin only if audio properties allow decoding.
Fixes ticket #2688. (cherry picked from commit 06bede95fcea47d2e51e8ff248c15311f335b898)
-rw-r--r--libavformat/idcin.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/idcin.c b/libavformat/idcin.c
index fd4504a566..fcfddfd1f6 100644
--- a/libavformat/idcin.c
+++ b/libavformat/idcin.c
@@ -91,7 +91,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
@@ -120,18 +120,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 certainly since this check is a bit sketchy */