[vlc-devel] commit: Directsound 7.1 support and some debug messages... (Kaarlo Raiha )

git version control git at videolan.org
Tue May 20 17:25:03 CEST 2008


vlc | branch: master | Kaarlo Raiha <kaarlo.raiha at tut.fi> | Tue May 20 11:36:44 2008 +0300| [f3efda92b1cba1161c5f59b94f55770a3f824beb]

Directsound 7.1 support and some debug messages...

...to help identify possible issues

Signed-off-by: Rémi Denis-Courmont <rem at videolan.org>

Squashed with VLC boolean updates.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f3efda92b1cba1161c5f59b94f55770a3f824beb
---

 modules/audio_output/directx.c |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/modules/audio_output/directx.c b/modules/audio_output/directx.c
index 2dd86f9..b3a1f48 100644
--- a/modules/audio_output/directx.c
+++ b/modules/audio_output/directx.c
@@ -418,6 +418,7 @@ static void Probe( aout_instance_t * p_aout )
     int i_format;
     unsigned int i_physical_channels;
     DWORD ui_speaker_config;
+    bool is_default_output_set = false;
 
     var_Create( p_aout, "audio-device", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
     text.psz_string = _("Audio Device");
@@ -437,6 +438,8 @@ static void Probe( aout_instance_t * p_aout )
             text.psz_string = "5.1";
             var_Change( p_aout, "audio-device",
                         VLC_VAR_ADDCHOICE, &val, &text );
+            var_Change( p_aout, "audio-device", VLC_VAR_SETDEFAULT, &val, NULL );
+            is_default_output_set = true;
             msg_Dbg( p_aout, "device supports 5.1 channels" );
         }
     }
@@ -456,6 +459,8 @@ static void Probe( aout_instance_t * p_aout )
                text.psz_string = "7.1";
                var_Change( p_aout, "audio-device",
                            VLC_VAR_ADDCHOICE, &val, &text );
+               var_Change( p_aout, "audio-device", VLC_VAR_SETDEFAULT, &val, NULL );
+               is_default_output_set = true;
                msg_Dbg( p_aout, "device supports 7.1 channels" );
            }
        }
@@ -474,6 +479,11 @@ static void Probe( aout_instance_t * p_aout )
             text.psz_string = N_("3 Front 2 Rear");
             var_Change( p_aout, "audio-device",
                         VLC_VAR_ADDCHOICE, &val, &text );
+            if(!is_default_output_set)
+            {
+                var_Change( p_aout, "audio-device", VLC_VAR_SETDEFAULT, &val, NULL );
+                is_default_output_set = true;
+            }
             msg_Dbg( p_aout, "device supports 5 channels" );
         }
     }
@@ -492,6 +502,11 @@ static void Probe( aout_instance_t * p_aout )
             text.psz_string = N_("2 Front 2 Rear");
             var_Change( p_aout, "audio-device",
                         VLC_VAR_ADDCHOICE, &val, &text );
+            if(!is_default_output_set)
+            {
+                var_Change( p_aout, "audio-device", VLC_VAR_SETDEFAULT, &val, NULL );
+                is_default_output_set = true;
+            }
             msg_Dbg( p_aout, "device supports 4 channels" );
         }
     }
@@ -505,7 +520,12 @@ static void Probe( aout_instance_t * p_aout )
         val.i_int = AOUT_VAR_STEREO;
         text.psz_string = N_("Stereo");
         var_Change( p_aout, "audio-device", VLC_VAR_ADDCHOICE, &val, &text );
-        var_Change( p_aout, "audio-device", VLC_VAR_SETDEFAULT, &val, NULL );
+        if(!is_default_output_set)
+        {
+            var_Change( p_aout, "audio-device", VLC_VAR_SETDEFAULT, &val, NULL );
+            is_default_output_set = true;
+            msg_Dbg( p_aout, "device supports 2 channels (DEFAULT!)" );
+        }
         msg_Dbg( p_aout, "device supports 2 channels" );
     }
 
@@ -527,16 +547,20 @@ static void Probe( aout_instance_t * p_aout )
                                               &ui_speaker_config ) )
     {
         ui_speaker_config = DSSPEAKER_STEREO;
+        msg_Dbg( p_aout, "GetSpeakerConfig failed" );
     }
     switch( DSSPEAKER_CONFIG(ui_speaker_config) )
     {
     case DSSPEAKER_7POINT1:
+        msg_Dbg( p_aout, "Windows says your SpeakerConfig is 7.1" );
         val.i_int = AOUT_VAR_7_1;
         break;
     case DSSPEAKER_5POINT1:
+        msg_Dbg( p_aout, "Windows says your SpeakerConfig is 5.1" );
         val.i_int = AOUT_VAR_5_1;
         break;
     case DSSPEAKER_QUAD:
+        msg_Dbg( p_aout, "Windows says your SpeakerConfig is Quad" );
         val.i_int = AOUT_VAR_2F2R;
         break;
 #if 0 /* Lots of people just get their settings wrong and complain that
@@ -546,8 +570,11 @@ static void Probe( aout_instance_t * p_aout )
         break;
 #endif
     case DSSPEAKER_SURROUND:
+        msg_Dbg( p_aout, "Windows says your SpeakerConfig is surround" );
     case DSSPEAKER_STEREO:
+        msg_Dbg( p_aout, "Windows says your SpeakerConfig is stereo" );
     default:
+        /* If nothing else is found, choose stereo output */
         val.i_int = AOUT_VAR_STEREO;
         break;
     }




More information about the vlc-devel mailing list