mirror of
https://code.videolan.org/videolan/vlc
synced 2024-09-08 11:26:59 +02:00
Replace remaining call sites of aout_BufferFree()
This commit is contained in:
parent
e412bf62a2
commit
8fbafffc9d
@ -125,8 +125,6 @@ typedef int32_t vlc_fixed_t;
|
||||
* Main audio output structures
|
||||
*****************************************************************************/
|
||||
|
||||
#define aout_BufferFree( buffer ) block_Release( buffer )
|
||||
|
||||
/* Size of a frame for S/PDIF output. */
|
||||
#define AOUT_SPDIF_SIZE 6144
|
||||
|
||||
|
@ -184,7 +184,7 @@ void AudioQueueCallback(void * inUserData, AudioQueueRef inAQ, AudioQueueBufferR
|
||||
if ( p_buffer != NULL ) {
|
||||
vlc_memcpy( inBuffer->mAudioData, p_buffer->p_buffer, p_buffer->i_buffer );
|
||||
inBuffer->mAudioDataByteSize = p_buffer->i_buffer;
|
||||
aout_BufferFree( p_buffer );
|
||||
block_Release( p_buffer );
|
||||
} else {
|
||||
vlc_memset( inBuffer->mAudioData, 0, inBuffer->mAudioDataBytesCapacity );
|
||||
inBuffer->mAudioDataByteSize = inBuffer->mAudioDataBytesCapacity;
|
||||
|
@ -1321,7 +1321,7 @@ static OSStatus RenderCallbackAnalog( vlc_object_t *_p_aout,
|
||||
vlc_memcpy( p_sys->p_remainder_buffer,
|
||||
&p_buffer->p_buffer[i_second_mData_bytes],
|
||||
p_sys->i_total_bytes );
|
||||
aout_BufferFree( p_buffer );
|
||||
block_Release( p_buffer );
|
||||
break;
|
||||
}
|
||||
else
|
||||
@ -1330,7 +1330,7 @@ static OSStatus RenderCallbackAnalog( vlc_object_t *_p_aout,
|
||||
current_date += (mtime_t) ( (mtime_t) 1000000 / p_aout->format.i_rate ) *
|
||||
( i_second_mData_bytes / 4 / aout_FormatNbChannels( &p_aout->format ) ); // 4 is fl32 specific
|
||||
}
|
||||
aout_BufferFree( p_buffer );
|
||||
block_Release( p_buffer );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1382,7 +1382,7 @@ static OSStatus RenderCallbackSPDIF( AudioDeviceID inDevice,
|
||||
|
||||
/* move data into output data buffer */
|
||||
vlc_memcpy( BUFFER.mData, p_buffer->p_buffer, p_buffer->i_buffer );
|
||||
aout_BufferFree( p_buffer );
|
||||
block_Release( p_buffer );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -984,7 +984,7 @@ static int FillBuffer( audio_output_t *p_aout, int i_frame,
|
||||
if( dsresult != DS_OK )
|
||||
{
|
||||
msg_Warn( p_aout, "cannot lock buffer" );
|
||||
if( p_buffer ) aout_BufferFree( p_buffer );
|
||||
if( p_buffer ) block_Release( p_buffer );
|
||||
return VLC_EGENERIC;
|
||||
}
|
||||
|
||||
@ -1003,7 +1003,7 @@ static int FillBuffer( audio_output_t *p_aout, int i_frame,
|
||||
}
|
||||
|
||||
vlc_memcpy( p_write_position, p_buffer->p_buffer, l_bytes1 );
|
||||
aout_BufferFree( p_buffer );
|
||||
block_Release( p_buffer );
|
||||
}
|
||||
|
||||
/* Now the data has been copied, unlock the buffer */
|
||||
|
@ -322,5 +322,5 @@ static void Play( audio_output_t * p_aout, block_t *p_buffer )
|
||||
p_aout->sys->waveh.DataLength += p_buffer->i_buffer;
|
||||
}
|
||||
|
||||
aout_BufferFree( p_buffer );
|
||||
block_Release( p_buffer );
|
||||
}
|
||||
|
@ -300,9 +300,7 @@ int Process( jack_nframes_t i_frames, void *p_arg )
|
||||
}
|
||||
|
||||
if( p_buffer )
|
||||
{
|
||||
aout_BufferFree( p_buffer );
|
||||
}
|
||||
block_Release( p_buffer );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -326,7 +326,7 @@ static ULONG APIENTRY KaiCallback( PVOID p_cb_data,
|
||||
|
||||
next_date += p_aout_buffer->i_length;
|
||||
|
||||
aout_BufferFree( p_aout_buffer );
|
||||
block_Release( p_aout_buffer );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -558,7 +558,7 @@ static void OSSThreadCleanup( void *data )
|
||||
{
|
||||
oss_thread_ctx_t *p_ctx = data;
|
||||
if( p_ctx->p_buffer )
|
||||
aout_BufferFree( p_ctx->p_buffer );
|
||||
block_Release( p_ctx->p_buffer );
|
||||
else
|
||||
free( p_ctx->p_bytes );
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ static void aout_FifoReset( aout_fifo_t * p_fifo )
|
||||
while ( p_buffer != NULL )
|
||||
{
|
||||
aout_buffer_t * p_next = p_buffer->p_next;
|
||||
aout_BufferFree( p_buffer );
|
||||
block_Release( p_buffer );
|
||||
p_buffer = p_next;
|
||||
}
|
||||
p_fifo->p_first = NULL;
|
||||
@ -121,7 +121,7 @@ static void aout_FifoDestroy( aout_fifo_t * p_fifo )
|
||||
while ( p_buffer != NULL )
|
||||
{
|
||||
aout_buffer_t * p_next = p_buffer->p_next;
|
||||
aout_BufferFree( p_buffer );
|
||||
block_Release( p_buffer );
|
||||
p_buffer = p_next;
|
||||
}
|
||||
|
||||
@ -294,7 +294,7 @@ static block_t *aout_OutputSlice (audio_output_t *p_aout)
|
||||
needed -= avail;
|
||||
p_out += avail;
|
||||
/* Next buffer */
|
||||
aout_BufferFree( aout_FifoPop( p_fifo ) );
|
||||
block_Release( aout_FifoPop( p_fifo ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -849,7 +849,7 @@ static int WaveOutClearDoneBuffers(aout_sys_t *p_sys)
|
||||
sizeof(WAVEHDR) );
|
||||
|
||||
if( p_waveheader[i].dwUser != 1 )
|
||||
aout_BufferFree( p_buffer );
|
||||
block_Release( p_buffer );
|
||||
|
||||
p_waveheader[i].dwUser = 0;
|
||||
}
|
||||
|
@ -271,7 +271,7 @@ block_t *aout_DecNewBuffer (audio_output_t *aout, size_t samples)
|
||||
void aout_DecDeleteBuffer (audio_output_t *aout, block_t *block)
|
||||
{
|
||||
(void) aout;
|
||||
aout_BufferFree (block);
|
||||
block_Release (block);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@ -296,7 +296,7 @@ int aout_DecPlay (audio_output_t *p_aout, block_t *p_buffer, int i_input_rate)
|
||||
if (unlikely(input == NULL)) /* can happen due to restart */
|
||||
{
|
||||
aout_unlock( p_aout );
|
||||
aout_BufferFree( p_buffer );
|
||||
block_Release( p_buffer );
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -549,7 +549,7 @@ block_t *aout_InputPlay(audio_output_t *p_aout, aout_input_t *p_input,
|
||||
|
||||
static void inputDrop( aout_input_t *p_input, aout_buffer_t *p_buffer )
|
||||
{
|
||||
aout_BufferFree( p_buffer );
|
||||
block_Release( p_buffer );
|
||||
|
||||
p_input->i_buffer_lost++;
|
||||
}
|
||||
|
@ -1163,7 +1163,7 @@ static void DecoderPlayAudio( decoder_t *p_dec, aout_buffer_t *p_audio,
|
||||
{
|
||||
msg_Warn( p_dec, "non-dated audio buffer received" );
|
||||
*pi_lost_sum += 1;
|
||||
aout_BufferFree( p_audio );
|
||||
block_Release( p_audio );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1239,7 +1239,7 @@ static void DecoderPlayAudio( decoder_t *p_dec, aout_buffer_t *p_audio,
|
||||
{
|
||||
msg_Dbg( p_dec, "discarded audio buffer" );
|
||||
*pi_lost_sum += 1;
|
||||
aout_BufferFree( p_audio );
|
||||
block_Release( p_audio );
|
||||
}
|
||||
|
||||
if( !b_has_more )
|
||||
@ -1713,7 +1713,7 @@ static void DecoderFlushBuffering( decoder_t *p_dec )
|
||||
p_owner->buffer.p_audio = p_audio->p_next;
|
||||
p_owner->buffer.i_count--;
|
||||
|
||||
aout_BufferFree( p_audio );
|
||||
block_Release( p_audio );
|
||||
|
||||
if( !p_owner->buffer.p_audio )
|
||||
p_owner->buffer.pp_audio_next = &p_owner->buffer.p_audio;
|
||||
|
Loading…
Reference in New Issue
Block a user