]> git.sesse.net Git - vlc/blobdiff - modules/audio_output/waveout.c
mozilla: fix out-of-tree compilation on macosx
[vlc] / modules / audio_output / waveout.c
index fbee1c0ab161c6a4326f17ac621d617cbc86ad74..b7efbe2c413d00f51511acfa9f71d49f03ab2e4b 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <string.h>                                            /* strerror() */
-#include <stdlib.h>                            /* calloc(), malloc(), free() */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include <vlc/vlc.h>
-#include <vlc/aout.h>
-#include "aout_internal.h"
+#include <vlc_aout.h>
 
 #include <windows.h>
 #include <mmsystem.h>
@@ -487,7 +488,7 @@ static void Close( vlc_object_t *p_this )
     aout_sys_t *p_sys = p_aout->output.p_sys;
 
     /* Before calling waveOutClose we must reset the device */
-    p_aout->b_die = VLC_TRUE;
+    vlc_object_kill( p_aout );
 
     waveOutReset( p_sys->h_waveout );
 
@@ -744,12 +745,14 @@ static void WaveOutThread( notification_thread_t *p_notif )
             if( (p_waveheader[i].dwFlags & WHDR_DONE) &&
                 p_waveheader[i].dwUser )
             {
+                aout_buffer_t *p_buffer =
+                        (aout_buffer_t *)(p_waveheader[i].dwUser);
                 /* Unprepare and free the buffers which has just been played */
                 waveOutUnprepareHeader( p_sys->h_waveout, &p_waveheader[i],
                                         sizeof(WAVEHDR) );
 
                 if( p_waveheader[i].dwUser != 1 )
-                    aout_BufferFree( (aout_buffer_t *)p_waveheader[i].dwUser );
+                    aout_BufferFree( p_buffer );
 
                 p_waveheader[i].dwUser = 0;
             }