summaryrefslogtreecommitdiff
path: root/libavformat/dv.c
diff options
context:
space:
mode:
authorRoman Shaposhnik <roman@shaposhnik.org>2008-10-07 16:14:33 +0000
committerRoman Shaposhnik <roman@shaposhnik.org>2008-10-07 16:14:33 +0000
commita53621fca8d0250bc5b21a688232985b8146e77f (patch)
treec45a191697ae2754d7e3ff037f81ba2c3c6b1a5b /libavformat/dv.c
parent45580f8d4d90782e684792f252fe10a705703546 (diff)
simplifying code as per Michael's suggestion
Originally committed as revision 15583 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/dv.c')
-rw-r--r--libavformat/dv.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavformat/dv.c b/libavformat/dv.c
index 41010b189c..b7458828b1 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -201,10 +201,9 @@ static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame)
quant = as_pack[4] & 0x07; /* 0 - 16bit linear, 1 - 12bit nonlinear */
/* note: ach counts PAIRS of channels (i.e. stereo channels) */
- if (stype == 3) {
- ach = 4;
- } else
- ach = (stype == 2 || (quant && (freq == 2))) ? 2 : 1;
+ ach = (int[4]){ 1, 0, 2, 4}[stype];
+ if (ach == 1 && quant && freq == 2)
+ ach = 2;
/* Dynamic handling of the audio streams in DV */
for (i=0; i<ach; i++) {