]> git.sesse.net Git - vlc/commitdiff
* backport of [11313]
authorDerk-Jan Hartman <hartman@videolan.org>
Sun, 5 Jun 2005 23:47:31 +0000 (23:47 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Sun, 5 Jun 2005 23:47:31 +0000 (23:47 +0000)
modules/audio_output/auhal.c

index bb446e47f36f5158407f3bd8cbdc94241cd726fb..2e173184ba06468d9edba4cfb76ea3985b8dd641 100644 (file)
@@ -300,36 +300,40 @@ static int Open( vlc_object_t * p_this )
                 continue;
             default:
                 msg_Warn( p_aout, "Unrecognized channel form provided by driver: %d", (int)layout->mChannelDescriptions[i].mChannelLabel );
-                switch( layout->mNumberChannelDescriptions )
+                if( i == 0 )
                 {
-                    /* We make assumptions based on number of channels here.
-                     * Unfortunatly Apple has provided no 100% method to retrieve the speaker configuration */
-                    case 1:
-                        p_aout->output.output.i_physical_channels = AOUT_CHAN_CENTER;
-                        break;
-                    case 4:
-                        p_aout->output.output.i_physical_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT |
-                                                                    AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT;
-                        break;
-                    case 6:
-                        p_aout->output.output.i_physical_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT |
-                                                                    AOUT_CHAN_CENTER | AOUT_CHAN_LFE |
-                                                                    AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT;
-                        break;
-                    case 7:
-                        p_aout->output.output.i_physical_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT |
-                                                                    AOUT_CHAN_CENTER | AOUT_CHAN_LFE |
-                                                                    AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_REARCENTER;
-                        break;
-                    case 8:
-                        p_aout->output.output.i_physical_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT |
-                                                                    AOUT_CHAN_CENTER | AOUT_CHAN_LFE |
-                                                                    AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT |
-                                                                    AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT;
-                        break;
-                    case 2:
-                    default:
-                        p_aout->output.output.i_physical_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
+                    msg_Warn( p_aout, "Probably no channellayout is set. force based on channelcount" );
+                    switch( layout->mNumberChannelDescriptions )
+                    {
+                        /* We make assumptions based on number of channels here.
+                         * Unfortunatly Apple has provided no 100% method to retrieve the speaker configuration */
+                        case 1:
+                            p_aout->output.output.i_physical_channels = AOUT_CHAN_CENTER;
+                            break;
+                        case 4:
+                            p_aout->output.output.i_physical_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT |
+                                                                        AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT;
+                            break;
+                        case 6:
+                            p_aout->output.output.i_physical_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT |
+                                                                        AOUT_CHAN_CENTER | AOUT_CHAN_LFE |
+                                                                        AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT;
+                            break;
+                        case 7:
+                            p_aout->output.output.i_physical_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT |
+                                                                        AOUT_CHAN_CENTER | AOUT_CHAN_LFE |
+                                                                        AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_REARCENTER;
+                            break;
+                        case 8:
+                            p_aout->output.output.i_physical_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT |
+                                                                        AOUT_CHAN_CENTER | AOUT_CHAN_LFE |
+                                                                        AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT |
+                                                                        AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT;
+                            break;
+                        case 2:
+                        default:
+                            p_aout->output.output.i_physical_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
+                    }
                 }
                 break;
         }