]> git.sesse.net Git - vlc/blobdiff - modules/audio_output/waveout.c
DirectSound: better logging
[vlc] / modules / audio_output / waveout.c
index 1cd427c66016f65879672cbb1a1442df3d506e55..f5a1975f1c77a654966da93e355a195322df02d1 100644 (file)
@@ -60,7 +60,7 @@ static int OpenWaveOutPCM( audio_output_t *, uint32_t,
 static int PlayWaveOut   ( audio_output_t *, HWAVEOUT, WAVEHDR *,
                            aout_buffer_t *, bool );
 
-static void CALLBACK WaveOutCallback ( HWAVEOUT, UINT, DWORD, DWORD, DWORD );
+static void CALLBACK WaveOutCallback ( HWAVEOUT, UINT, DWORD_PTR, DWORD_PTR, DWORD_PTR );
 static void* WaveOutThread( void * );
 
 static int VolumeSet( audio_output_t *, float, bool );
@@ -92,14 +92,14 @@ vlc_module_begin ()
     set_capability( "audio output", 50 )
     set_category( CAT_AUDIO )
     set_subcategory( SUBCAT_AUDIO_AOUT )
-    add_bool( "waveout-float32", true, FLOAT_TEXT, FLOAT_LONGTEXT, true )
 
     add_string( "waveout-audio-device", "wavemapper",
                  DEVICE_TEXT, DEVICE_LONG, false )
-       add_deprecated_alias( "waveout-dev" )   /* deprecated since 0.9.3 */
        change_string_list( ppsz_adev, ppsz_adev_text, ReloadWaveoutDevices )
        change_action_add( ReloadWaveoutDevices, N_("Refresh list") )
 
+    add_bool( "waveout-float32", true, FLOAT_TEXT, FLOAT_LONGTEXT, true )
+
     set_callbacks( Open, Close )
 vlc_module_end ()
 
@@ -240,7 +240,7 @@ static int Open( vlc_object_t *p_this )
         p_aout->sys->i_buffer_size =
             p_aout->format.i_bytes_per_frame;
 
-        aout_PacketInit( p_aout, &p_aout->p_sys->packet, A52_FRAME_NB );
+        aout_PacketInit( p_aout, &p_aout->sys->packet, A52_FRAME_NB );
         aout_VolumeNoneInit( p_aout );
     }
     else
@@ -286,7 +286,7 @@ static int Open( vlc_object_t *p_this )
         p_aout->sys->i_buffer_size = FRAME_SIZE *
             p_aout->format.i_bytes_per_frame;
 
-        aout_PacketInit( p_aout, &p_aout->p_sys->packet, FRAME_SIZE );
+        aout_PacketInit( p_aout, &p_aout->sys->packet, FRAME_SIZE );
         aout_VolumeSoftInit( p_aout );
 
         /* Check for hardware volume support */
@@ -311,6 +311,7 @@ static int Open( vlc_object_t *p_this )
         malloc( p_aout->sys->i_buffer_size );
     if( p_aout->sys->p_silence_buffer == NULL )
     {
+        aout_PacketDestroy( p_aout );
         free( p_aout->sys );
         return VLC_ENOMEM;
     }
@@ -436,7 +437,7 @@ static void Probe( audio_output_t * p_aout )
     }
 
     /* Test for SPDIF support */
-    if ( AOUT_FMT_NON_LINEAR( &p_aout->format ) )
+    if ( AOUT_FMT_SPDIF( &p_aout->format ) )
     {
         if( OpenWaveOut( p_aout,
                          p_aout->sys->i_wave_device_id,
@@ -800,8 +801,8 @@ static int PlayWaveOut( audio_output_t *p_aout, HWAVEOUT h_waveout,
  * WaveOutCallback: what to do once WaveOut has played its sound samples
  *****************************************************************************/
 static void CALLBACK WaveOutCallback( HWAVEOUT h_waveout, UINT uMsg,
-                                      DWORD _p_aout,
-                                      DWORD dwParam1, DWORD dwParam2 )
+                                      DWORD_PTR _p_aout,
+                                      DWORD_PTR dwParam1, DWORD_PTR dwParam2 )
 {
     (void)h_waveout;    (void)dwParam1;    (void)dwParam2;
     audio_output_t *p_aout = (audio_output_t *)_p_aout;
@@ -897,7 +898,7 @@ static void* WaveOutThread( void *data )
     // than wait a short time... before grabbing first frames
     mwait( p_sys->start_date - AOUT_MAX_PTS_ADVANCE/4 );
 
-#define waveout_warn(msg) msg_Warn( p_aout, "aout_OutputNextBuffer no buffer "\
+#define waveout_warn(msg) msg_Warn( p_aout, "aout_PacketNext no buffer "\
                            "got next_date=%d ms, "\
                            "%d frames to play, %s",\
                            (int)(next_date/(mtime_t)1000), \
@@ -926,25 +927,19 @@ static void* WaveOutThread( void *data )
 
 
                 /* Take into account the latency */
-                p_buffer = aout_OutputNextBuffer( p_aout,
-                    next_date,
-                    b_sleek );
-
+                p_buffer = aout_PacketNext( p_aout, next_date );
                 if(!p_buffer)
                 {
 #if 0
-                    msg_Dbg( p_aout, "aout_OutputNextBuffer no buffer "
-                                      "got next_date=%d ms, "
-                                      "%d frames to play",
-                                      (int)(next_date/(mtime_t)1000),
-                                      i_queued_frames);
+                    msg_Dbg( p_aout, "aout_PacketNext no buffer got "
+                             "next_date=%"PRId64" ms, %d frames to play",
+                             next_date/1000, i_queued_frames);
 #endif
                     // means we are too early to request a new buffer?
                     waveout_warn("waiting...")
                     mwait( next_date - AOUT_MAX_PTS_ADVANCE/4 );
                     next_date = mdate();
-                    p_buffer = aout_OutputNextBuffer( p_aout, next_date,
-                                                      b_sleek );
+                    p_buffer = aout_PacketNext( p_aout, next_date );
                 }
 
                 if( !p_buffer && i_queued_frames )