# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_aout.h>
#include <vlc_charset.h>
static const char psz_device_name_fmt[] = "%s ($%x,$%x)";
-static const char *ppsz_adev[] = { "wavemapper", };
-static const char *ppsz_adev_text[] = { N_("Microsoft Soundmapper") };
+static const char *const ppsz_adev[] = { "wavemapper", };
+static const char *const ppsz_adev_text[] = { N_("Microsoft Soundmapper") };
vlc_module_begin();
set_shortname( "WaveOut" );
- set_description( _("Win32 waveOut extension output") );
+ set_description( N_("Win32 waveOut extension output") );
set_capability( "audio output", 50 );
set_category( CAT_AUDIO );
set_subcategory( SUBCAT_AUDIO_AOUT );
p_aout->output.p_sys = malloc( sizeof( aout_sys_t ) );
if( p_aout->output.p_sys == NULL )
- {
- msg_Err( p_aout, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
p_aout->output.pf_play = Play;
p_aout->b_die = false;
if( p_aout->output.p_sys->p_silence_buffer == NULL )
{
free( p_aout->output.p_sys );
- msg_Err( p_aout, "out of memory" );
return 1;
}
p_aout->output.p_sys->i_repeat_counter = 0;
if( uMsg != WOM_DONE ) return;
- if( p_aout->b_die ) return;
+ if( !vlc_object_alive (p_aout) ) return;
/* Find out the current latency */
for( i = 0; i < FRAMES_NUM; i++ )
b_sleek = p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i');
// wait for first call to "play()"
- while( !p_sys->start_date && !p_aout->b_die )
+ while( !p_sys->start_date && vlc_object_alive (p_aout) )
WaitForSingleObject( p_sys->event, INFINITE );
- if( p_aout->b_die )
+ if( !vlc_object_alive (p_aout) )
return;
msg_Dbg( p_aout, "will start to play in %"PRId64" us",
p_aout->output.b_starving, msg);
next_date = mdate();
- while( !p_aout->b_die )
+ while( vlc_object_alive (p_aout) )
{
/* Cleanup and find out the current latency */
i_queued_frames = WaveOutClearDoneBuffers( p_sys );
- if( p_aout->b_die ) return;
+ if( !vlc_object_alive (p_aout) ) return;
/* Try to fill in as many frame buffers as possible */
for( i = 0; i < FRAMES_NUM; i++ )
}
}
- if( p_aout->b_die ) return;
+ if( !vlc_object_alive (p_aout) ) return;
/*
deal with the case that the loop didn't fillup the buffer to the