[vlc-commits] Replace remaining call sites of aout_BufferFree()
Rémi Denis-Courmont
git at videolan.org
Tue May 22 22:33:17 CEST 2012
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue May 22 23:06:52 2012 +0300| [8fbafffc9db909c7d84b66a1e90c7ca56f7161c9] | committer: Rémi Denis-Courmont
Replace remaining call sites of aout_BufferFree()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8fbafffc9db909c7d84b66a1e90c7ca56f7161c9
---
include/vlc_aout.h | 2 --
modules/audio_output/audioqueue.c | 2 +-
modules/audio_output/auhal.c | 6 +++---
modules/audio_output/directx.c | 4 ++--
modules/audio_output/file.c | 2 +-
modules/audio_output/jack.c | 4 +---
modules/audio_output/kai.c | 2 +-
modules/audio_output/oss.c | 2 +-
modules/audio_output/packet.c | 6 +++---
modules/audio_output/waveout.c | 2 +-
src/audio_output/dec.c | 4 ++--
src/audio_output/input.c | 2 +-
src/input/decoder.c | 6 +++---
13 files changed, 20 insertions(+), 24 deletions(-)
diff --git a/include/vlc_aout.h b/include/vlc_aout.h
index 870d77f..c537767 100644
--- a/include/vlc_aout.h
+++ b/include/vlc_aout.h
@@ -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
diff --git a/modules/audio_output/audioqueue.c b/modules/audio_output/audioqueue.c
index f427a5f..7719e06 100644
--- a/modules/audio_output/audioqueue.c
+++ b/modules/audio_output/audioqueue.c
@@ -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;
diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index 09e9293..9ae8588 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -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
{
diff --git a/modules/audio_output/directx.c b/modules/audio_output/directx.c
index fa0b4d2..9b14e5f 100644
--- a/modules/audio_output/directx.c
+++ b/modules/audio_output/directx.c
@@ -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 */
diff --git a/modules/audio_output/file.c b/modules/audio_output/file.c
index 0b731a2..d368701 100644
--- a/modules/audio_output/file.c
+++ b/modules/audio_output/file.c
@@ -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 );
}
diff --git a/modules/audio_output/jack.c b/modules/audio_output/jack.c
index 86ffd2e..44399ae 100644
--- a/modules/audio_output/jack.c
+++ b/modules/audio_output/jack.c
@@ -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;
}
diff --git a/modules/audio_output/kai.c b/modules/audio_output/kai.c
index 199f718..f65b9c9 100644
--- a/modules/audio_output/kai.c
+++ b/modules/audio_output/kai.c
@@ -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
{
diff --git a/modules/audio_output/oss.c b/modules/audio_output/oss.c
index b4ec373..67da43e 100644
--- a/modules/audio_output/oss.c
+++ b/modules/audio_output/oss.c
@@ -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 );
}
diff --git a/modules/audio_output/packet.c b/modules/audio_output/packet.c
index b1d4dc1..d88d129 100644
--- a/modules/audio_output/packet.c
+++ b/modules/audio_output/packet.c
@@ -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
diff --git a/modules/audio_output/waveout.c b/modules/audio_output/waveout.c
index e2f18af..55b5172 100644
--- a/modules/audio_output/waveout.c
+++ b/modules/audio_output/waveout.c
@@ -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;
}
diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index 2ca2324..1f9985b 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -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;
}
diff --git a/src/audio_output/input.c b/src/audio_output/input.c
index 228132b..cdd923b 100644
--- a/src/audio_output/input.c
+++ b/src/audio_output/input.c
@@ -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++;
}
diff --git a/src/input/decoder.c b/src/input/decoder.c
index b68df6f..7704ceb 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -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;
More information about the vlc-commits
mailing list