struct aout_sys_t
{
+ aout_packet_t packet;
audio_output_t *p_aout;
PaStream *p_stream;
set_subcategory( SUBCAT_AUDIO_AOUT )
add_integer( "portaudio-audio-device", 0,
DEVICE_TEXT, DEVICE_LONGTEXT, false )
- add_deprecated_alias( "portaudio-device" ) /* deprecated since 0.9.3 */
set_capability( "audio output", 0 )
set_callbacks( Open, Close )
vlc_module_end ()
out_date = mdate() + (mtime_t) ( 1000000 *
( paDate->outputBufferDacTime - paDate->currentTime ) );
- p_buffer = aout_OutputNextBuffer( p_aout, out_date, true );
+ p_buffer = aout_PacketNext( p_aout, out_date );
if ( p_buffer != NULL )
{
}
vlc_memcpy( outputBuffer, p_buffer->p_buffer,
framesPerBuffer * p_sys->i_sample_size );
- /* aout_BufferFree may be dangereous here, but then so is
- * aout_OutputNextBuffer (calls aout_BufferFree internally).
- * one solution would be to link the no longer useful buffers
- * in a second fifo (in aout_OutputNextBuffer too) and to
- * wait until we are in Play to do the actual free.
- */
aout_BufferFree( p_buffer );
}
else
#endif
msg_Dbg( p_aout, "portaudio closed");
+ aout_PacketDestroy( p_aout );
free( p_sys );
}
/* Calculate the frame size in bytes */
p_sys->i_sample_size = 4 * i_channels;
- p_aout->i_nb_samples = FRAME_SIZE;
aout_FormatPrepare( &p_aout->format );
+ aout_PacketInit( p_aout, &p_sys->packet, FRAME_SIZE );
aout_VolumeSoftInit( p_aout );
/* Check for channel reordering */
paLastHostErrorInfo->errorText );
}
p_sys->p_stream = 0;
+ aout_PacketDestroy( p_aout );
return VLC_EGENERIC;
}
{
msg_Err( p_aout, "Pa_StartStream() failed" );
Pa_CloseStream( p_sys->p_stream );
+ aout_PacketDestroy( p_aout );
return VLC_EGENERIC;
}