]> git.sesse.net Git - vlc/blobdiff - modules/audio_output/waveout.c
update module LIST file.
[vlc] / modules / audio_output / waveout.c
old mode 100755 (executable)
new mode 100644 (file)
index be5809f..b7c7d1f
@@ -276,7 +276,7 @@ static int Open( vlc_object_t *p_this )
                          "use default instead", psz_waveout_dev );
        }
     }
-    if(psz_waveout_dev) free( psz_waveout_dev );
+    free( psz_waveout_dev );
 
 
     WAVEOUTCAPS waveoutcaps;
@@ -847,13 +847,13 @@ static int PlayWaveOut( aout_instance_t *p_aout, HWAVEOUT h_waveout,
     MMRESULT result;
 
     /* Prepare the buffer */
-    if( p_buffer != NULL ) 
+    if( p_buffer != NULL )
     {
         p_waveheader->lpData = p_buffer->p_buffer;
         /*
           copy the buffer to the silence buffer :) so in case we don't
           get the next buffer fast enough (I will repeat this one a time
-          for AC3 / DTS and SPDIF this will sound better instead of 
+          for AC3 / DTS and SPDIF this will sound better instead of
           a hickup)
         */
         if(b_spdif)
@@ -1193,11 +1193,11 @@ static int ReloadWaveoutDevices( vlc_object_t *p_this, char const *psz_name,
         if(waveOutGetDevCaps(i, &caps, sizeof(WAVEOUTCAPS))
            == MMSYSERR_NOERROR)
         {
-          sprintf(sz_dev_name,psz_device_name_fmt,caps.szPname,
+          sprintf( sz_dev_name, psz_device_name_fmt, caps.szPname,
                                                caps.wMid,
                                                caps.wPid
                                               );
-          p_item->ppsz_list[j] = strdup( sz_dev_name );
+          p_item->ppsz_list[j] = FromLocaleDup( sz_dev_name );
           p_item->ppsz_list_text[j] = FromLocaleDup( sz_dev_name );
           p_item->i_list++;
           j++;
@@ -1216,7 +1216,7 @@ static int ReloadWaveoutDevices( vlc_object_t *p_this, char const *psz_name,
 /*
   convert devicename to device ID for output
   if device not found return WAVE_MAPPER, so let
-  windows decide which prefered audio device
+  windows decide which preferred audio device
   should be used.
 */
 static uint32_t findDeviceID(char *psz_device_name)
@@ -1232,12 +1232,18 @@ static uint32_t findDeviceID(char *psz_device_name)
         if(waveOutGetDevCaps(i, &caps, sizeof(WAVEOUTCAPS))
            == MMSYSERR_NOERROR)
         {
-            sprintf(sz_dev_name,psz_device_name_fmt,caps.szPname,
+            sprintf(sz_dev_name, psz_device_name_fmt, caps.szPname,
                                                caps.wMid,
                                                caps.wPid
                                               );
-            if(!stricmp(sz_dev_name,psz_device_name))
-               return i;
+            char *psz_temp = FromLocaleDup(sz_dev_name);
+
+            if( !stricmp(psz_temp, psz_device_name) )
+            {
+                LocaleFree( psz_temp );
+                return i;
+            }
+            LocaleFree( psz_temp );
         }
     }