# include "config.h"
#endif
-#include <vlc/vlc.h>
-
-#ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-#endif
+#include <vlc_common.h>
#include <vlc_aout.h>
void CloseAudio ( vlc_object_t *p_this );
static int GetBufInfo ( aout_instance_t * );
static void Play ( aout_instance_t * );
-static int QNXaoutThread ( aout_instance_t * );
+static void* QNXaoutThread ( vlc_object_t * );
/*****************************************************************************
* Open : creates a handle and opens an alsa device
/* allocate structure */
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 -1;
- }
/* open audio device */
if( ( i_ret = snd_pcm_open_preferred( &p_aout->output.p_sys->p_pcm_handle,
}
pp.format.voices = i_nb_channels;
- p_aout->output.output.i_format = AOUT_FMT_S16_NE;
+ p_aout->output.output.i_format = VLC_CODEC_S16N;
p_aout->output.i_nb_samples = DEFAULT_FRAME_SIZE;
pp.format.format = SND_PCM_SFMT_S16;
i_bytes_per_sample = 2;
/* Create audio thread and wait for its readiness. */
if( vlc_thread_create( p_aout, "aout", QNXaoutThread,
- VLC_THREAD_PRIORITY_OUTPUT, false ) )
+ VLC_THREAD_PRIORITY_OUTPUT ) )
{
msg_Err( p_aout, "cannot create QNX audio thread (%m)" );
CloseAudio( p_this );
/*****************************************************************************
* QNXaoutThread: asynchronous thread used to DMA the data to the device
*****************************************************************************/
-static int QNXaoutThread( aout_instance_t * p_aout )
+static void* QNXaoutThread( vlc_object_t *p_this )
{
+ aout_instance_t * p_aout = (aout_instance_t*)p_this;
struct aout_sys_t * p_sys = p_aout->output.p_sys;
+ int canc = vlc_savecancel ();
- while ( !p_aout->b_die )
+ while ( vlc_object_alive (p_aout) )
{
aout_buffer_t * p_buffer;
int i_tmp, i_size;
uint8_t * p_bytes;
- if ( p_aout->output.output.i_format != VLC_FOURCC('s','p','d','i') )
+ if ( p_aout->output.output.i_format != VLC_CODEC_SPDIFL )
{
mtime_t next_date = 0;
if ( p_buffer != NULL )
{
p_bytes = p_buffer->p_buffer;
- i_size = p_buffer->i_nb_bytes;
+ i_size = p_buffer->i_buffer;
}
else
{
}
}
- return 0;
+ vlc_restorecancel (canc);
+ return NULL;
}