diff --git a/modules/packetizer/a52.c b/modules/packetizer/a52.c index 5e82503c426c1a93e2aa9228702ee1fad6148dac..0f768fc9a97afb804508607f93af30919d460585 100644 --- a/modules/packetizer/a52.c +++ b/modules/packetizer/a52.c @@ -2,7 +2,7 @@ * a52.c ***************************************************************************** * Copyright (C) 2001, 2002 VideoLAN - * $Id: a52.c,v 1.4 2003/04/13 20:00:21 fenrir Exp $ + * $Id: a52.c,v 1.5 2003/05/03 02:09:41 fenrir Exp $ * * Authors: Laurent Aimar <fenrir@via.ecp.fr> * Eric Petit <titer@videolan.org> @@ -133,8 +133,6 @@ static int Run( decoder_fifo_t *p_fifo ) EndThread( p_pack ); - FREE( p_pack ); - if( b_error ) { return( -1 ); @@ -306,6 +304,7 @@ static void EndThread ( packetizer_t *p_pack) { sout_InputDelete( p_pack->p_sout_input ); } + free( p_pack ); } /***************************************************************************** @@ -325,6 +324,7 @@ static int SyncInfo( const byte_t * p_buf, int * pi_channels, 512, 576, 640 }; static const uint8_t lfeon[8] = { 0x10, 0x10, 0x04, 0x04, 0x04, 0x01, 0x04, 0x01 }; + static const int acmod_to_channels[8] = { 2, 1, 2, 3, 3, 4, 4, 5 }; int frmsizecod; int bitrate; int half; @@ -346,36 +346,9 @@ static int SyncInfo( const byte_t * p_buf, int * pi_channels, | AOUT_CHAN_DOLBYSTEREO;*/ *pi_channels = 2; /* FIXME ??? */ } - else switch ( acmod ) + else { - case 0x0: - /* Dual-mono = stereo + dual-mono */ -// *pi_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT -// | AOUT_CHAN_DUALMONO; - *pi_channels = 2; /* FIXME ??? */ - break; - case 0x1: - /* Mono */ - *pi_channels = 1; - break; - case 0x2: - /* Stereo */ - *pi_channels = 2; - break; - case 0x3: /* 3F */ - case 0x4: /* 2F1R */ - *pi_channels = 3; - break; - case 0x5: /* 3F1R */ - case 0x6: /* 2F2R */ - *pi_channels = 4; - break; - case 0x7: - /* 3F2R */ - *pi_channels = 5; - break; - default: - return 0; + *pi_channels = acmod_to_channels[acmod&0x07]; } if ( p_buf[6] & lfeon[acmod] ) *pi_channels += 1;//|= AOUT_CHAN_LFEA; diff --git a/modules/packetizer/mpeg4audio.c b/modules/packetizer/mpeg4audio.c index 981e1b1cd4d8bae3fb3fecaf108a0c93ad1dc97c..8b5e0f0105d046be334adb735626f7df69383121 100644 --- a/modules/packetizer/mpeg4audio.c +++ b/modules/packetizer/mpeg4audio.c @@ -2,7 +2,7 @@ * mpeg4audio.c ***************************************************************************** * Copyright (C) 2001, 2002 VideoLAN - * $Id: mpeg4audio.c,v 1.5 2003/04/13 20:00:21 fenrir Exp $ + * $Id: mpeg4audio.c,v 1.6 2003/05/03 02:09:41 fenrir Exp $ * * Authors: Laurent Aimar <fenrir@via.ecp.fr> * @@ -361,5 +361,6 @@ static void EndThread ( packetizer_thread_t *p_pack) { free( p_pack->p_wf ); } + free( p_pack ); } diff --git a/modules/packetizer/mpeg4video.c b/modules/packetizer/mpeg4video.c index 6c1b9b3ca66a539cc5f636be56ff680e57a37d70..b521a4b21b183d5cd1c22a3309123bdcb65151b4 100644 --- a/modules/packetizer/mpeg4video.c +++ b/modules/packetizer/mpeg4video.c @@ -2,7 +2,7 @@ * mpeg4video.c ***************************************************************************** * Copyright (C) 2001, 2002 VideoLAN - * $Id: mpeg4video.c,v 1.11 2003/04/24 20:24:44 fenrir Exp $ + * $Id: mpeg4video.c,v 1.12 2003/05/03 02:09:41 fenrir Exp $ * * Authors: Laurent Aimar <fenrir@via.ecp.fr> * Eric Petit <titer@videolan.org> @@ -451,6 +451,7 @@ static void EndThread ( packetizer_thread_t *p_pack) { sout_InputDelete( p_pack->p_sout_input ); } + free( p_pack ); } static void input_ShowPES( decoder_fifo_t *p_fifo, pes_packet_t **pp_pes )