Commit b380a994 authored by Laurent Aimar's avatar Laurent Aimar

* all: who has seen that I have just forgot to release any buffers...

parent c3b01ee0
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* adpcm.c : adpcm variant audio decoder * adpcm.c : adpcm variant audio decoder
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: adpcm.c,v 1.14 2003/11/04 14:51:51 fenrir Exp $ * $Id: adpcm.c,v 1.15 2003/11/05 01:47:40 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -286,6 +286,7 @@ static int Decode( decoder_t *p_dec, block_t *p_block ) ...@@ -286,6 +286,7 @@ static int Decode( decoder_t *p_dec, block_t *p_block )
} }
else if( !aout_DateGet( &p_sys->date ) ) else if( !aout_DateGet( &p_sys->date ) )
{ {
block_Release( p_block );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
i_pts = 0; i_pts = 0;
...@@ -296,6 +297,7 @@ static int Decode( decoder_t *p_dec, block_t *p_block ) ...@@ -296,6 +297,7 @@ static int Decode( decoder_t *p_dec, block_t *p_block )
if( out == NULL ) if( out == NULL )
{ {
msg_Err( p_dec, "cannot get aout buffer" ); msg_Err( p_dec, "cannot get aout buffer" );
block_Release( p_block );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
out->start_date = aout_DateGet( &p_sys->date ); out->start_date = aout_DateGet( &p_sys->date );
...@@ -328,6 +330,7 @@ static int Decode( decoder_t *p_dec, block_t *p_block ) ...@@ -328,6 +330,7 @@ static int Decode( decoder_t *p_dec, block_t *p_block )
i_data -= p_sys->i_block; i_data -= p_sys->i_block;
} }
block_Release( p_block );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* araw.c: Pseudo audio decoder; for raw pcm data * araw.c: Pseudo audio decoder; for raw pcm data
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2003 VideoLAN * Copyright (C) 2001, 2003 VideoLAN
* $Id: araw.c,v 1.21 2003/11/04 01:27:33 fenrir Exp $ * $Id: araw.c,v 1.22 2003/11/05 01:47:40 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -217,7 +217,6 @@ static int DecoderInit( decoder_t *p_dec ) ...@@ -217,7 +217,6 @@ static int DecoderInit( decoder_t *p_dec )
{ {
msg_Err( p_dec, "bad samplerate" ); msg_Err( p_dec, "bad samplerate" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
p_sys->p_wf = p_wf; p_sys->p_wf = p_wf;
...@@ -364,6 +363,7 @@ static int DecoderDecode( decoder_t *p_dec, block_t *p_block ) ...@@ -364,6 +363,7 @@ static int DecoderDecode( decoder_t *p_dec, block_t *p_block )
} }
if( i_size < p_sys->p_wf->nBlockAlign ) if( i_size < p_sys->p_wf->nBlockAlign )
{ {
block_Release( p_block );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
i_samples = i_size / ( ( p_sys->p_wf->wBitsPerSample + 7 ) / 8 ) / i_samples = i_size / ( ( p_sys->p_wf->wBitsPerSample + 7 ) / 8 ) /
...@@ -375,6 +375,7 @@ static int DecoderDecode( decoder_t *p_dec, block_t *p_block ) ...@@ -375,6 +375,7 @@ static int DecoderDecode( decoder_t *p_dec, block_t *p_block )
} }
else if( !aout_DateGet( &p_sys->date ) ) else if( !aout_DateGet( &p_sys->date ) )
{ {
block_Release( p_block );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -387,6 +388,7 @@ static int DecoderDecode( decoder_t *p_dec, block_t *p_block ) ...@@ -387,6 +388,7 @@ static int DecoderDecode( decoder_t *p_dec, block_t *p_block )
if( out == NULL ) if( out == NULL )
{ {
msg_Err( p_dec, "cannot get aout buffer" ); msg_Err( p_dec, "cannot get aout buffer" );
block_Release( p_block );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -414,6 +416,7 @@ static int DecoderDecode( decoder_t *p_dec, block_t *p_block ) ...@@ -414,6 +416,7 @@ static int DecoderDecode( decoder_t *p_dec, block_t *p_block )
i_samples -= i_copy; i_samples -= i_copy;
} }
block_Release( p_block );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* decoder.c: AAC decoder using libfaad2 * decoder.c: AAC decoder using libfaad2
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2003 VideoLAN * Copyright (C) 2001, 2003 VideoLAN
* $Id: faad.c,v 1.2 2003/11/04 02:23:11 fenrir Exp $ * $Id: faad.c,v 1.3 2003/11/05 01:47:40 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -195,6 +195,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block ) ...@@ -195,6 +195,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block )
p_sys->p_buffer, p_sys->i_buffer, p_sys->p_buffer, p_sys->i_buffer,
&i_rate, &i_channels ) < 0 ) &i_rate, &i_channels ) < 0 )
{ {
block_Release( p_block );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
p_sys->output_format.i_rate = i_rate; p_sys->output_format.i_rate = i_rate;
...@@ -218,6 +219,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block ) ...@@ -218,6 +219,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block )
msg_Warn( p_dec, "%s", faacDecGetErrorMessage( frame.error ) ); msg_Warn( p_dec, "%s", faacDecGetErrorMessage( frame.error ) );
/* flush the buffer */ /* flush the buffer */
p_sys->i_buffer = 0; p_sys->i_buffer = 0;
block_Release( p_block );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
if( frame.channels <= 0 || frame.channels > 6 ) if( frame.channels <= 0 || frame.channels > 6 )
...@@ -225,6 +227,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block ) ...@@ -225,6 +227,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block )
msg_Warn( p_dec, "invalid channels count" ); msg_Warn( p_dec, "invalid channels count" );
/* flush the buffer */ /* flush the buffer */
p_sys->i_buffer = 0; p_sys->i_buffer = 0;
block_Release( p_block );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
if( frame.samples <= 0 ) if( frame.samples <= 0 )
...@@ -232,6 +235,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block ) ...@@ -232,6 +235,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block )
msg_Warn( p_dec, "decoded zero samples" ); msg_Warn( p_dec, "decoded zero samples" );
/* flush the buffer */ /* flush the buffer */
p_sys->i_buffer = 0; p_sys->i_buffer = 0;
block_Release( p_block );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -264,6 +268,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block ) ...@@ -264,6 +268,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block )
if( p_sys->p_aout_input == NULL ) if( p_sys->p_aout_input == NULL )
{ {
msg_Err( p_dec, "cannot create aout" ); msg_Err( p_dec, "cannot create aout" );
block_Release( p_block );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -284,6 +289,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block ) ...@@ -284,6 +289,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block )
frame.samples / frame.channels ) ) == NULL ) frame.samples / frame.channels ) ) == NULL )
{ {
msg_Err( p_dec, "cannot get a new buffer" ); msg_Err( p_dec, "cannot get a new buffer" );
block_Release( p_block );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
out->start_date = aout_DateGet( &p_sys->date ); out->start_date = aout_DateGet( &p_sys->date );
...@@ -300,6 +306,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block ) ...@@ -300,6 +306,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block )
memmove( &p_sys->p_buffer[0], &p_sys->p_buffer[i_used], p_sys->i_buffer ); memmove( &p_sys->p_buffer[0], &p_sys->p_buffer[i_used], p_sys->i_buffer );
} }
block_Release( p_block );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
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