Commit 8fbafffc authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Replace remaining call sites of aout_BufferFree()

parent e412bf62
...@@ -125,8 +125,6 @@ typedef int32_t vlc_fixed_t; ...@@ -125,8 +125,6 @@ typedef int32_t vlc_fixed_t;
* Main audio output structures * Main audio output structures
*****************************************************************************/ *****************************************************************************/
#define aout_BufferFree( buffer ) block_Release( buffer )
/* Size of a frame for S/PDIF output. */ /* Size of a frame for S/PDIF output. */
#define AOUT_SPDIF_SIZE 6144 #define AOUT_SPDIF_SIZE 6144
......
...@@ -184,7 +184,7 @@ void AudioQueueCallback(void * inUserData, AudioQueueRef inAQ, AudioQueueBufferR ...@@ -184,7 +184,7 @@ void AudioQueueCallback(void * inUserData, AudioQueueRef inAQ, AudioQueueBufferR
if ( p_buffer != NULL ) { if ( p_buffer != NULL ) {
vlc_memcpy( inBuffer->mAudioData, p_buffer->p_buffer, p_buffer->i_buffer ); vlc_memcpy( inBuffer->mAudioData, p_buffer->p_buffer, p_buffer->i_buffer );
inBuffer->mAudioDataByteSize = p_buffer->i_buffer; inBuffer->mAudioDataByteSize = p_buffer->i_buffer;
aout_BufferFree( p_buffer ); block_Release( p_buffer );
} else { } else {
vlc_memset( inBuffer->mAudioData, 0, inBuffer->mAudioDataBytesCapacity ); vlc_memset( inBuffer->mAudioData, 0, inBuffer->mAudioDataBytesCapacity );
inBuffer->mAudioDataByteSize = inBuffer->mAudioDataBytesCapacity; inBuffer->mAudioDataByteSize = inBuffer->mAudioDataBytesCapacity;
......
...@@ -1321,7 +1321,7 @@ static OSStatus RenderCallbackAnalog( vlc_object_t *_p_aout, ...@@ -1321,7 +1321,7 @@ static OSStatus RenderCallbackAnalog( vlc_object_t *_p_aout,
vlc_memcpy( p_sys->p_remainder_buffer, vlc_memcpy( p_sys->p_remainder_buffer,
&p_buffer->p_buffer[i_second_mData_bytes], &p_buffer->p_buffer[i_second_mData_bytes],
p_sys->i_total_bytes ); p_sys->i_total_bytes );
aout_BufferFree( p_buffer ); block_Release( p_buffer );
break; break;
} }
else else
...@@ -1330,7 +1330,7 @@ static OSStatus RenderCallbackAnalog( vlc_object_t *_p_aout, ...@@ -1330,7 +1330,7 @@ static OSStatus RenderCallbackAnalog( vlc_object_t *_p_aout,
current_date += (mtime_t) ( (mtime_t) 1000000 / p_aout->format.i_rate ) * 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 ( i_second_mData_bytes / 4 / aout_FormatNbChannels( &p_aout->format ) ); // 4 is fl32 specific
} }
aout_BufferFree( p_buffer ); block_Release( p_buffer );
} }
else else
{ {
...@@ -1382,7 +1382,7 @@ static OSStatus RenderCallbackSPDIF( AudioDeviceID inDevice, ...@@ -1382,7 +1382,7 @@ static OSStatus RenderCallbackSPDIF( AudioDeviceID inDevice,
/* move data into output data buffer */ /* move data into output data buffer */
vlc_memcpy( BUFFER.mData, p_buffer->p_buffer, p_buffer->i_buffer ); vlc_memcpy( BUFFER.mData, p_buffer->p_buffer, p_buffer->i_buffer );
aout_BufferFree( p_buffer ); block_Release( p_buffer );
} }
else else
{ {
......
...@@ -984,7 +984,7 @@ static int FillBuffer( audio_output_t *p_aout, int i_frame, ...@@ -984,7 +984,7 @@ static int FillBuffer( audio_output_t *p_aout, int i_frame,
if( dsresult != DS_OK ) if( dsresult != DS_OK )
{ {
msg_Warn( p_aout, "cannot lock buffer" ); msg_Warn( p_aout, "cannot lock buffer" );
if( p_buffer ) aout_BufferFree( p_buffer ); if( p_buffer ) block_Release( p_buffer );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -1003,7 +1003,7 @@ static int FillBuffer( audio_output_t *p_aout, int i_frame, ...@@ -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 ); 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 */ /* 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 ) ...@@ -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; 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 ) ...@@ -300,9 +300,7 @@ int Process( jack_nframes_t i_frames, void *p_arg )
} }
if( p_buffer ) if( p_buffer )
{ block_Release( p_buffer );
aout_BufferFree( p_buffer );
}
return 0; return 0;
} }
......
...@@ -326,7 +326,7 @@ static ULONG APIENTRY KaiCallback( PVOID p_cb_data, ...@@ -326,7 +326,7 @@ static ULONG APIENTRY KaiCallback( PVOID p_cb_data,
next_date += p_aout_buffer->i_length; next_date += p_aout_buffer->i_length;
aout_BufferFree( p_aout_buffer ); block_Release( p_aout_buffer );
} }
else else
{ {
......
...@@ -558,7 +558,7 @@ static void OSSThreadCleanup( void *data ) ...@@ -558,7 +558,7 @@ static void OSSThreadCleanup( void *data )
{ {
oss_thread_ctx_t *p_ctx = data; oss_thread_ctx_t *p_ctx = data;
if( p_ctx->p_buffer ) if( p_ctx->p_buffer )
aout_BufferFree( p_ctx->p_buffer ); block_Release( p_ctx->p_buffer );
else else
free( p_ctx->p_bytes ); free( p_ctx->p_bytes );
} }
......
...@@ -72,7 +72,7 @@ static void aout_FifoReset( aout_fifo_t * p_fifo ) ...@@ -72,7 +72,7 @@ static void aout_FifoReset( aout_fifo_t * p_fifo )
while ( p_buffer != NULL ) while ( p_buffer != NULL )
{ {
aout_buffer_t * p_next = p_buffer->p_next; aout_buffer_t * p_next = p_buffer->p_next;
aout_BufferFree( p_buffer ); block_Release( p_buffer );
p_buffer = p_next; p_buffer = p_next;
} }
p_fifo->p_first = NULL; p_fifo->p_first = NULL;
...@@ -121,7 +121,7 @@ static void aout_FifoDestroy( aout_fifo_t * p_fifo ) ...@@ -121,7 +121,7 @@ static void aout_FifoDestroy( aout_fifo_t * p_fifo )
while ( p_buffer != NULL ) while ( p_buffer != NULL )
{ {
aout_buffer_t * p_next = p_buffer->p_next; aout_buffer_t * p_next = p_buffer->p_next;
aout_BufferFree( p_buffer ); block_Release( p_buffer );
p_buffer = p_next; p_buffer = p_next;
} }
...@@ -294,7 +294,7 @@ static block_t *aout_OutputSlice (audio_output_t *p_aout) ...@@ -294,7 +294,7 @@ static block_t *aout_OutputSlice (audio_output_t *p_aout)
needed -= avail; needed -= avail;
p_out += avail; p_out += avail;
/* Next buffer */ /* Next buffer */
aout_BufferFree( aout_FifoPop( p_fifo ) ); block_Release( aout_FifoPop( p_fifo ) );
} }
} }
else else
......
...@@ -849,7 +849,7 @@ static int WaveOutClearDoneBuffers(aout_sys_t *p_sys) ...@@ -849,7 +849,7 @@ static int WaveOutClearDoneBuffers(aout_sys_t *p_sys)
sizeof(WAVEHDR) ); sizeof(WAVEHDR) );
if( p_waveheader[i].dwUser != 1 ) if( p_waveheader[i].dwUser != 1 )
aout_BufferFree( p_buffer ); block_Release( p_buffer );
p_waveheader[i].dwUser = 0; p_waveheader[i].dwUser = 0;
} }
......
...@@ -271,7 +271,7 @@ block_t *aout_DecNewBuffer (audio_output_t *aout, size_t samples) ...@@ -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_DecDeleteBuffer (audio_output_t *aout, block_t *block)
{ {
(void) aout; (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) ...@@ -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 */ if (unlikely(input == NULL)) /* can happen due to restart */
{ {
aout_unlock( p_aout ); aout_unlock( p_aout );
aout_BufferFree( p_buffer ); block_Release( p_buffer );
return -1; return -1;
} }
......
...@@ -549,7 +549,7 @@ block_t *aout_InputPlay(audio_output_t *p_aout, aout_input_t *p_input, ...@@ -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 ) 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++; p_input->i_buffer_lost++;
} }
......
...@@ -1163,7 +1163,7 @@ static void DecoderPlayAudio( decoder_t *p_dec, aout_buffer_t *p_audio, ...@@ -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" ); msg_Warn( p_dec, "non-dated audio buffer received" );
*pi_lost_sum += 1; *pi_lost_sum += 1;
aout_BufferFree( p_audio ); block_Release( p_audio );
return; return;
} }
...@@ -1239,7 +1239,7 @@ static void DecoderPlayAudio( decoder_t *p_dec, aout_buffer_t *p_audio, ...@@ -1239,7 +1239,7 @@ static void DecoderPlayAudio( decoder_t *p_dec, aout_buffer_t *p_audio,
{ {
msg_Dbg( p_dec, "discarded audio buffer" ); msg_Dbg( p_dec, "discarded audio buffer" );
*pi_lost_sum += 1; *pi_lost_sum += 1;
aout_BufferFree( p_audio ); block_Release( p_audio );
} }
if( !b_has_more ) if( !b_has_more )
...@@ -1713,7 +1713,7 @@ static void DecoderFlushBuffering( decoder_t *p_dec ) ...@@ -1713,7 +1713,7 @@ static void DecoderFlushBuffering( decoder_t *p_dec )
p_owner->buffer.p_audio = p_audio->p_next; p_owner->buffer.p_audio = p_audio->p_next;
p_owner->buffer.i_count--; p_owner->buffer.i_count--;
aout_BufferFree( p_audio ); block_Release( p_audio );
if( !p_owner->buffer.p_audio ) if( !p_owner->buffer.p_audio )
p_owner->buffer.pp_audio_next = &p_owner->buffer.p_audio; p_owner->buffer.pp_audio_next = &p_owner->buffer.p_audio;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment