]> git.sesse.net Git - vlc/blobdiff - modules/audio_output/sdl.c
OSS: path from VLC core (or ASCII), need utf8_open()
[vlc] / modules / audio_output / sdl.c
index 5a5ccc14ad2cf448e3634ce93246b8eaf1f99063..070e2f6a27c3f2da37159ec10fa0574c462244c3 100644 (file)
@@ -37,7 +37,7 @@
 #include <vlc_plugin.h>
 #include <vlc_aout.h>
 
-#include SDL_INCLUDE_FILE
+#include <SDL/SDL.h>
 
 #define FRAME_SIZE 2048
 
@@ -108,11 +108,9 @@ static int Open ( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
-    if ( var_Type( p_aout, "audio-device" ) != 0 )
+    if( var_Get( p_aout, "audio-device", &val ) != VLC_ENOVAR )
     {
         /* The user has selected an audio device. */
-        vlc_value_t val;
-        var_Get( p_aout, "audio-device", &val );
         if ( val.i_int == AOUT_VAR_STEREO )
         {
             p_aout->output.output.i_physical_channels
@@ -151,17 +149,17 @@ static int Open ( vlc_object_t *p_this )
     switch ( obtained.format )
     {
     case AUDIO_S16LSB:
-        p_aout->output.output.i_format = VLC_FOURCC('s','1','6','l'); break;
+        p_aout->output.output.i_format = VLC_CODEC_S16L; break;
     case AUDIO_S16MSB:
-        p_aout->output.output.i_format = VLC_FOURCC('s','1','6','b'); break;
+        p_aout->output.output.i_format = VLC_CODEC_S16B; break;
     case AUDIO_U16LSB:
-        p_aout->output.output.i_format = VLC_FOURCC('u','1','6','l'); break;
+        p_aout->output.output.i_format = VLC_CODEC_U16L; break;
     case AUDIO_U16MSB:
-        p_aout->output.output.i_format = VLC_FOURCC('u','1','6','b'); break;
+        p_aout->output.output.i_format = VLC_CODEC_U16B; break;
     case AUDIO_S8:
-        p_aout->output.output.i_format = VLC_FOURCC('s','8',' ',' '); break;
+        p_aout->output.output.i_format = VLC_CODEC_S8; break;
     case AUDIO_U8:
-        p_aout->output.output.i_format = VLC_FOURCC('u','8',' ',' '); break;
+        p_aout->output.output.i_format = VLC_CODEC_U8; break;
     }
     /* Volume is entirely done in software. */
     aout_VolumeSoftInit( p_aout );
@@ -181,8 +179,8 @@ static int Open ( vlc_object_t *p_this )
 
             val.i_int = (obtained.channels == 2) ? AOUT_VAR_STEREO :
                         AOUT_VAR_MONO;
-            text.psz_string = (obtained.channels == 2) ? N_("Stereo") :
-                              N_("Mono");
+            text.psz_string = (obtained.channels == 2) ? _("Stereo") :
+                              _("Mono");
             var_Change( p_aout, "audio-device",
                         VLC_VAR_ADDCHOICE, &val, &text );
             var_AddCallback( p_aout, "audio-device", aout_ChannelsRestart,
@@ -198,10 +196,10 @@ static int Open ( vlc_object_t *p_this )
         var_Change( p_aout, "audio-device", VLC_VAR_SETTEXT, &text, NULL );
 
         val.i_int = AOUT_VAR_STEREO;
-        text.psz_string = N_("Stereo");
+        text.psz_string = _("Stereo");
         var_Change( p_aout, "audio-device", VLC_VAR_ADDCHOICE, &val, &text );
         val.i_int = AOUT_VAR_MONO;
-        text.psz_string = N_("Mono");
+        text.psz_string = _("Mono");
         var_Change( p_aout, "audio-device", VLC_VAR_ADDCHOICE, &val, &text );
         if ( i_nb_channels == 2 )
         {
@@ -215,8 +213,7 @@ static int Open ( vlc_object_t *p_this )
         var_AddCallback( p_aout, "audio-device", aout_ChannelsRestart, NULL );
     }
 
-    val.b_bool = true;
-    var_Set( p_aout, "intf-change", val );
+    var_SetBool( p_aout, "intf-change", true );
 
     p_aout->output.output.i_rate = obtained.freq;
     p_aout->output.i_nb_samples = obtained.samples;