From 26e930b5e2f0e92da0926e0fa3e3b8b9efeb898e Mon Sep 17 00:00:00 2001 From: Gildas Bazin Date: Wed, 24 Dec 2003 09:46:08 +0000 Subject: [PATCH] * include/vlc_block.h: added a temporary i_rate field to block_t. * modules/codec/libmpeg2.c: synchro uses p_block->i_rate again. * src/input/*: do not decode audio when i_rate != DEFAULT_RATE. --- include/vlc_block.h | 3 ++- modules/codec/libmpeg2.c | 4 ++-- src/input/es_out.c | 6 ++++-- src/input/input_dec.c | 3 ++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/vlc_block.h b/include/vlc_block.h index 779183147f..95b2783dfb 100644 --- a/include/vlc_block.h +++ b/include/vlc_block.h @@ -2,7 +2,7 @@ * vlc_block.h: Data blocks management functions ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: vlc_block.h,v 1.4 2003/10/27 01:04:38 gbazin Exp $ + * $Id: vlc_block.h,v 1.5 2003/12/24 09:46:08 gbazin Exp $ * * Authors: Laurent Aimar * @@ -40,6 +40,7 @@ struct block_t mtime_t i_length; vlc_bool_t b_discontinuity; /* only temporary */ + int i_rate; int i_buffer; uint8_t *p_buffer; diff --git a/modules/codec/libmpeg2.c b/modules/codec/libmpeg2.c index 2946913405..a8d1bd2cfc 100755 --- a/modules/codec/libmpeg2.c +++ b/modules/codec/libmpeg2.c @@ -2,7 +2,7 @@ * libmpeg2.c: mpeg2 video decoder module making use of libmpeg2. ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: libmpeg2.c,v 1.40 2003/12/22 16:40:04 gbazin Exp $ + * $Id: libmpeg2.c,v 1.41 2003/12/24 09:46:08 gbazin Exp $ * * Authors: Gildas Bazin * Christophe Massiot @@ -221,7 +221,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) p_sys->i_current_pts = p_block->i_pts; } - p_sys->i_current_rate = DEFAULT_RATE;//p_pes->i_rate; + p_sys->i_current_rate = p_block->i_rate; mpeg2_buffer( p_sys->p_mpeg2dec, p_block->p_buffer, p_block->p_buffer + p_block->i_buffer ); diff --git a/src/input/es_out.c b/src/input/es_out.c index 9cbc987de7..8ae0dc8e97 100644 --- a/src/input/es_out.c +++ b/src/input/es_out.c @@ -2,7 +2,7 @@ * es_out.c: Es Out handler for input. ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: es_out.c,v 1.10 2003/12/22 02:24:50 sam Exp $ + * $Id: es_out.c,v 1.11 2003/12/24 09:46:08 gbazin Exp $ * * Authors: Laurent Aimar * @@ -465,7 +465,9 @@ static int EsOutSend( es_out_t *out, es_out_id_t *es, block_t *p_block ) } vlc_mutex_lock( &out->p_sys->p_input->stream.stream_lock ); - if( es->p_es->p_dec ) + p_block->i_rate = out->p_sys->p_input->stream.control.i_rate; + if( es->p_es->p_dec && + (es->p_es->i_cat!=AUDIO_ES || !p_sys->p_input->stream.control.b_mute) ) { input_DecodeBlock( es->p_es->p_dec, p_block ); } diff --git a/src/input/input_dec.c b/src/input/input_dec.c index 887f1fbfe0..3845bfffa3 100644 --- a/src/input/input_dec.c +++ b/src/input/input_dec.c @@ -2,7 +2,7 @@ * input_dec.c: Functions for the management of decoders ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: input_dec.c,v 1.82 2003/11/30 16:00:24 fenrir Exp $ + * $Id: input_dec.c,v 1.83 2003/12/24 09:46:08 gbazin Exp $ * * Authors: Christophe Massiot * Gildas Bazin @@ -265,6 +265,7 @@ void input_DecodePES( decoder_t * p_dec, pes_packet_t * p_pes ) p_block->i_pts = p_pes->i_pts; p_block->i_dts = p_pes->i_dts; p_block->b_discontinuity = p_pes->b_discontinuity; + p_block->i_rate = p_pes->i_rate; input_DecodeBlock( p_dec, p_block ); } -- 2.39.2