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

This commit is contained in:
Laurent Aimar 2003-11-05 01:47:40 +00:00
parent c3b01ee068
commit b380a99486
3 changed files with 17 additions and 4 deletions

View File

@ -2,7 +2,7 @@
* adpcm.c : adpcm variant audio decoder
*****************************************************************************
* 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>
*
@ -286,6 +286,7 @@ static int Decode( decoder_t *p_dec, block_t *p_block )
}
else if( !aout_DateGet( &p_sys->date ) )
{
block_Release( p_block );
return VLC_SUCCESS;
}
i_pts = 0;
@ -296,6 +297,7 @@ static int Decode( decoder_t *p_dec, block_t *p_block )
if( out == NULL )
{
msg_Err( p_dec, "cannot get aout buffer" );
block_Release( p_block );
return VLC_EGENERIC;
}
out->start_date = aout_DateGet( &p_sys->date );
@ -328,6 +330,7 @@ static int Decode( decoder_t *p_dec, block_t *p_block )
i_data -= p_sys->i_block;
}
block_Release( p_block );
return VLC_SUCCESS;
}

View File

@ -2,7 +2,7 @@
* araw.c: Pseudo audio decoder; for raw pcm data
*****************************************************************************
* 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>
*
@ -217,7 +217,6 @@ static int DecoderInit( decoder_t *p_dec )
{
msg_Err( p_dec, "bad samplerate" );
return VLC_EGENERIC;
}
p_sys->p_wf = p_wf;
@ -364,6 +363,7 @@ static int DecoderDecode( decoder_t *p_dec, block_t *p_block )
}
if( i_size < p_sys->p_wf->nBlockAlign )
{
block_Release( p_block );
return VLC_SUCCESS;
}
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 )
}
else if( !aout_DateGet( &p_sys->date ) )
{
block_Release( p_block );
return VLC_SUCCESS;
}
@ -387,6 +388,7 @@ static int DecoderDecode( decoder_t *p_dec, block_t *p_block )
if( out == NULL )
{
msg_Err( p_dec, "cannot get aout buffer" );
block_Release( p_block );
return VLC_EGENERIC;
}
@ -414,6 +416,7 @@ static int DecoderDecode( decoder_t *p_dec, block_t *p_block )
i_samples -= i_copy;
}
block_Release( p_block );
return VLC_SUCCESS;
}

View File

@ -2,7 +2,7 @@
* decoder.c: AAC decoder using libfaad2
*****************************************************************************
* 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>
*
@ -195,6 +195,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block )
p_sys->p_buffer, p_sys->i_buffer,
&i_rate, &i_channels ) < 0 )
{
block_Release( p_block );
return VLC_EGENERIC;
}
p_sys->output_format.i_rate = i_rate;
@ -218,6 +219,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block )
msg_Warn( p_dec, "%s", faacDecGetErrorMessage( frame.error ) );
/* flush the buffer */
p_sys->i_buffer = 0;
block_Release( p_block );
return VLC_SUCCESS;
}
if( frame.channels <= 0 || frame.channels > 6 )
@ -225,6 +227,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block )
msg_Warn( p_dec, "invalid channels count" );
/* flush the buffer */
p_sys->i_buffer = 0;
block_Release( p_block );
return VLC_SUCCESS;
}
if( frame.samples <= 0 )
@ -232,6 +235,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block )
msg_Warn( p_dec, "decoded zero samples" );
/* flush the buffer */
p_sys->i_buffer = 0;
block_Release( p_block );
return VLC_SUCCESS;
}
@ -264,6 +268,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block )
if( p_sys->p_aout_input == NULL )
{
msg_Err( p_dec, "cannot create aout" );
block_Release( p_block );
return VLC_EGENERIC;
}
@ -284,6 +289,7 @@ static int RunDecoder ( decoder_t *p_dec, block_t *p_block )
frame.samples / frame.channels ) ) == NULL )
{
msg_Err( p_dec, "cannot get a new buffer" );
block_Release( p_block );
return VLC_EGENERIC;
}
out->start_date = aout_DateGet( &p_sys->date );
@ -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 );
}
block_Release( p_block );
return VLC_SUCCESS;
}