Browse code

simplifying code as per Michael's suggestion

Originally committed as revision 15583 to svn://svn.ffmpeg.org/ffmpeg/trunk

Roman Shaposhnik authored on 2008/10/08 01:14:33
Showing 1 changed files
... ...
@@ -201,10 +201,9 @@ static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame)
201 201
     quant = as_pack[4] & 0x07; /* 0 - 16bit linear, 1 - 12bit nonlinear */
202 202
 
203 203
     /* note: ach counts PAIRS of channels (i.e. stereo channels) */
204
-    if (stype == 3) {
205
-        ach = 4;
206
-    } else
207
-    ach = (stype == 2 || (quant && (freq == 2))) ? 2 : 1;
204
+    ach = (int[4]){  1,  0,  2,  4}[stype];
205
+    if (ach == 1 && quant && freq == 2)
206
+        ach = 2;
208 207
 
209 208
     /* Dynamic handling of the audio streams in DV */
210 209
     for (i=0; i<ach; i++) {