[FFmpeg-cvslog] Autodetect idcin only if audio properties allow decoding.
Carl Eugen Hoyos
git at videolan.org
Sun Oct 6 19:06:17 CEST 2013
ffmpeg | branch: release/0.7 | Carl Eugen Hoyos <cehoyos at ag.or.at> | Wed Jun 19 16:31:10 2013 +0200| [2a1bebfc83db072cb2c984e4cebb4dd261f9d51f] | committer: Carl Eugen Hoyos
Autodetect idcin only if audio properties allow decoding.
Fixes ticket #2688.
(cherry picked from commit 06bede95fcea47d2e51e8ff248c15311f335b898)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2a1bebfc83db072cb2c984e4cebb4dd261f9d51f
---
libavformat/idcin.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/libavformat/idcin.c b/libavformat/idcin.c
index baff2d4..6aa259c 100644
--- a/libavformat/idcin.c
+++ b/libavformat/idcin.c
@@ -90,7 +90,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
@@ -119,18 +119,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 */
More information about the ffmpeg-cvslog
mailing list