changeset 3968:3bbaeba57939

iterated a52 channel setup
author arpi
date Thu, 03 Jan 2002 23:14:13 +0000
parents faf5af8e5481
children c4c3f32dae47
files dec_audio.c
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/dec_audio.c	Thu Jan 03 22:59:21 2002 +0000
+++ b/dec_audio.c	Thu Jan 03 23:14:13 2002 +0000
@@ -563,10 +563,12 @@
 	driver=0;break;
   }
   // 'a52 cannot upmix' hotfix:
-  sh_audio->channels=a52_printinfo(sh_audio);
-  if(audio_output_channels<sh_audio->channels)
-      sh_audio->channels=audio_output_channels;
+  a52_printinfo(sh_audio);
+//  if(audio_output_channels<sh_audio->channels)
+//      sh_audio->channels=audio_output_channels;
   // channels setup:
+  sh_audio->channels=audio_output_channels;
+while(sh_audio->channels>0){
   switch(sh_audio->channels){
 	    case 1: a52_flags=A52_MONO; break;
 //	    case 2: a52_flags=A52_STEREO; break;
@@ -586,7 +588,10 @@
   }
   mp_msg(MSGT_DECAUDIO,MSGL_V,"A52 flags after a52_frame: 0x%X\n",flags);
   // frame decoded, let's init resampler:
-  if(!a52_resample_init(a52_accel,flags,sh_audio->channels)){
+  if(a52_resample_init(a52_accel,flags,sh_audio->channels)) break;
+  --sh_audio->channels; // try to decrease no. of channels
+}
+  if(sh_audio->channels<=0){
     mp_msg(MSGT_DECAUDIO,MSGL_ERR,"a52: no resampler. try different channel setup!\n");
     driver=0;break;
   }