Commit aed1e85b authored by gbazin's avatar gbazin

* ALL: moved i_bitrate out of audio_format_t into es_format_t
parent 45cb9def
......@@ -2,7 +2,7 @@
* audio_output.h : audio output interface
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: audio_output.h,v 1.84 2003/11/16 21:07:30 gbazin Exp $
* $Id: audio_output.h,v 1.85 2003/11/16 22:54:11 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -55,7 +55,6 @@ struct audio_format_t
*/
/* FIXME ? (used by the codecs) */
int i_bitrate;
int i_channels;
int i_blockalign;
int i_bitspersample;
......
......@@ -2,7 +2,7 @@
* a52.c: parse A/52 audio sync info and packetize the stream
*****************************************************************************
* Copyright (C) 2001-2002 VideoLAN
* $Id: a52.c,v 1.29 2003/11/16 21:07:30 gbazin Exp $
* $Id: a52.c,v 1.30 2003/11/16 22:54:12 gbazin Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -334,7 +334,6 @@ static uint8_t *GetOutBuffer( decoder_t *p_dec, void **pp_out_buffer )
p_dec->fmt_out.audio.i_rate = p_sys->i_rate;
p_dec->fmt_out.audio.i_channels = p_sys->i_channels;
p_dec->fmt_out.audio.i_bitrate = p_sys->i_bit_rate;
p_dec->fmt_out.audio.i_bytes_per_frame = p_sys->i_frame_size;
p_dec->fmt_out.audio.i_frame_length = A52_FRAME_NB;
......@@ -342,6 +341,8 @@ static uint8_t *GetOutBuffer( decoder_t *p_dec, void **pp_out_buffer )
p_dec->fmt_out.audio.i_physical_channels =
p_sys->i_channels_conf & AOUT_CHAN_PHYSMASK;
p_dec->fmt_out.i_bitrate = p_sys->i_bit_rate;
if( p_sys->b_packetizer )
{
block_t *p_sout_buffer = GetSoutBuffer( p_dec );
......
......@@ -2,7 +2,7 @@
* dts.c: parse DTS audio sync info and packetize the stream
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: dts.c,v 1.5 2003/11/16 21:07:30 gbazin Exp $
* $Id: dts.c,v 1.6 2003/11/16 22:54:12 gbazin Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Gildas Bazin <gbazin@netcourrier.com>
......@@ -355,7 +355,6 @@ static uint8_t *GetOutBuffer( decoder_t *p_dec, void **pp_out_buffer )
p_dec->fmt_out.audio.i_rate = p_sys->i_rate;
p_dec->fmt_out.audio.i_channels = p_sys->i_channels;
p_dec->fmt_out.audio.i_bitrate = p_sys->i_bit_rate;
p_dec->fmt_out.audio.i_bytes_per_frame = p_sys->i_frame_size;
p_dec->fmt_out.audio.i_frame_length = p_sys->i_frame_length;
......@@ -363,6 +362,8 @@ static uint8_t *GetOutBuffer( decoder_t *p_dec, void **pp_out_buffer )
p_dec->fmt_out.audio.i_physical_channels =
p_sys->i_channels_conf & AOUT_CHAN_PHYSMASK;
p_dec->fmt_out.i_bitrate = p_sys->i_bit_rate;
if( p_sys->b_packetizer )
{
block_t *p_sout_buffer = GetSoutBuffer( p_dec );
......
......@@ -2,7 +2,7 @@
* mpeg_audio.c: parse MPEG audio sync info and packetize the stream
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: mpeg_audio.c,v 1.22 2003/11/16 21:07:30 gbazin Exp $
* $Id: mpeg_audio.c,v 1.23 2003/11/16 22:54:12 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
......@@ -473,7 +473,6 @@ static uint8_t *GetOutBuffer( decoder_t *p_dec, void **pp_out_buffer )
p_dec->fmt_out.audio.i_rate = p_sys->i_rate;
p_dec->fmt_out.audio.i_channels = p_sys->i_channels;
p_dec->fmt_out.audio.i_bitrate = p_sys->i_bit_rate;
p_dec->fmt_out.audio.i_frame_length = p_sys->i_frame_length;
p_dec->fmt_out.audio.i_bytes_per_frame =
p_sys->i_max_frame_size + MAD_BUFFER_GUARD;
......@@ -482,6 +481,8 @@ static uint8_t *GetOutBuffer( decoder_t *p_dec, void **pp_out_buffer )
p_dec->fmt_out.audio.i_physical_channels =
p_sys->i_channels_conf & AOUT_CHAN_PHYSMASK;
p_dec->fmt_out.i_bitrate = p_sys->i_bit_rate;
if( p_sys->b_packetizer )
{
block_t *p_sout_buffer = GetSoutBuffer( p_dec );
......
......@@ -2,7 +2,7 @@
* vorbis.c: vorbis decoder/encoder/packetizer module making use of libvorbis.
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: vorbis.c,v 1.22 2003/11/16 21:07:30 gbazin Exp $
* $Id: vorbis.c,v 1.23 2003/11/16 22:54:12 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -259,10 +259,10 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
/* Setup the format */
p_dec->fmt_out.audio.i_rate = p_sys->vi.rate;
p_dec->fmt_out.audio.i_channels = p_sys->vi.channels;
p_dec->fmt_out.audio.i_bitrate = p_sys->vi.bitrate_nominal;
p_dec->fmt_out.audio.i_physical_channels =
p_dec->fmt_out.audio.i_original_channels =
pi_channels_maps[p_sys->vi.channels];
p_dec->fmt_out.i_bitrate = p_sys->vi.bitrate_nominal;
aout_DateInit( &p_sys->end_date, p_sys->vi.rate );
......
......@@ -2,7 +2,7 @@
* asf.c : ASFv01 file input module for vlc
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: asf.c,v 1.41 2003/11/16 21:07:31 gbazin Exp $
* $Id: asf.c,v 1.42 2003/11/16 22:54:12 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -187,7 +187,7 @@ static int Open( vlc_object_t * p_this )
wf_tag_to_fourcc( GetWLE( &p_data[0] ), &fmt.i_codec, NULL );
fmt.audio.i_channels = GetWLE( &p_data[2] );
fmt.audio.i_rate = GetDWLE( &p_data[4] );
fmt.audio.i_bitrate = GetDWLE( &p_data[8] ) * 8;
fmt.i_bitrate = GetDWLE( &p_data[8] ) * 8;
fmt.audio.i_blockalign = GetWLE( &p_data[12] );
fmt.audio.i_bitspersample = GetWLE( &p_data[14] );
......
......@@ -2,7 +2,7 @@
* au.c : au file input module for vlc
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: au.c,v 1.9 2003/11/16 21:07:31 gbazin Exp $
* $Id: au.c,v 1.10 2003/11/16 22:54:12 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -262,9 +262,9 @@ static int Open( vlc_object_t * p_this )
i_cat = AU_CAT_UNKNOWN;
goto error;
}
p_sys->fmt.audio.i_bitrate = p_sys->fmt.audio.i_rate *
p_sys->fmt.audio.i_channels *
p_sys->fmt.audio.i_bitspersample;
p_sys->fmt.i_bitrate = p_sys->fmt.audio.i_rate *
p_sys->fmt.audio.i_channels *
p_sys->fmt.audio.i_bitspersample;
if( i_cat == AU_CAT_UNKNOWN || i_cat == AU_CAT_ADPCM )
{
......@@ -306,7 +306,7 @@ static int Open( vlc_object_t * p_this )
msg_Err( p_input, "cannot init stream" );
goto error;
}
p_input->stream.i_mux_rate = p_sys->fmt.audio.i_bitrate / 50 / 8;
p_input->stream.i_mux_rate = p_sys->fmt.i_bitrate / 50 / 8;
vlc_mutex_unlock( &p_input->stream.stream_lock );
p_sys->p_es = es_out_Add( p_input->p_es_out, &p_sys->fmt );
......
......@@ -2,7 +2,7 @@
* avi.c : AVI file Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: avi.c,v 1.69 2003/11/16 21:07:31 gbazin Exp $
* $Id: avi.c,v 1.70 2003/11/16 22:54:12 gbazin Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -275,7 +275,7 @@ static int Open( vlc_object_t * p_this )
fmt.audio.i_channels = p_auds->p_wf->nChannels;
fmt.audio.i_rate = p_auds->p_wf->nSamplesPerSec;
fmt.audio.i_bitrate = p_auds->p_wf->nAvgBytesPerSec * 8;
fmt.i_bitrate = p_auds->p_wf->nAvgBytesPerSec*8;
fmt.audio.i_blockalign = p_auds->p_wf->nBlockAlign;
fmt.audio.i_bitspersample = p_auds->p_wf->wBitsPerSample;
if( ( fmt.i_extra = __MIN( p_auds->p_wf->cbSize,
......
......@@ -2,7 +2,7 @@
* mkv.cpp : matroska demuxer
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: mkv.cpp,v 1.40 2003/11/16 21:07:31 gbazin Exp $
* $Id: mkv.cpp,v 1.41 2003/11/16 22:54:12 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -1069,7 +1069,7 @@ static int Open( vlc_object_t * p_this )
tk.fmt.audio.i_channels = GetWLE( &p_wf->nChannels );
tk.fmt.audio.i_rate = GetDWLE( &p_wf->nSamplesPerSec );
tk.fmt.audio.i_bitrate = GetDWLE( &p_wf->nAvgBytesPerSec ) * 8;
tk.fmt.i_bitrate = GetDWLE( &p_wf->nAvgBytesPerSec ) * 8;
tk.fmt.audio.i_blockalign = GetWLE( &p_wf->nBlockAlign );;
tk.fmt.audio.i_bitspersample = GetWLE( &p_wf->wBitsPerSample );
......
......@@ -2,7 +2,7 @@
* mpga.c : MPEG-I/II Audio input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: mpga.c,v 1.8 2003/11/16 21:07:31 gbazin Exp $
* $Id: mpga.c,v 1.9 2003/11/16 22:54:12 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -312,7 +312,7 @@ static int Open( vlc_object_t * p_this )
fmt.audio.i_channels = MPGA_CHANNELS( header );
fmt.audio.i_rate = MPGA_SAMPLE_RATE( header );
fmt.audio.i_bitrate = p_sys->i_bitrate_avg;
fmt.i_bitrate = p_sys->i_bitrate_avg;
}
vlc_mutex_lock( &p_input->stream.stream_lock );
......
......@@ -2,7 +2,7 @@
* wav.c : wav file input module for vlc
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: wav.c,v 1.9 2003/11/16 21:07:31 gbazin Exp $
* $Id: wav.c,v 1.10 2003/11/16 22:54:12 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -137,7 +137,7 @@ static int Open( vlc_object_t * p_this )
p_sys->fmt.audio.i_channels = GetWLE ( &p_wf->nChannels );
p_sys->fmt.audio.i_rate = GetDWLE( &p_wf->nSamplesPerSec );
p_sys->fmt.audio.i_blockalign = GetWLE ( &p_wf->nBlockAlign );
p_sys->fmt.audio.i_bitrate = GetDWLE( &p_wf->nAvgBytesPerSec ) * 8;
p_sys->fmt.i_bitrate = GetDWLE( &p_wf->nAvgBytesPerSec ) * 8;
p_sys->fmt.audio.i_bitspersample = GetWLE ( &p_wf->wBitsPerSample );;
p_sys->fmt.i_extra = GetWLE ( &p_wf->cbSize );
......@@ -151,7 +151,7 @@ static int Open( vlc_object_t * p_this )
GetWLE( &p_wf->wFormatTag ),
p_sys->fmt.audio.i_channels,
p_sys->fmt.audio.i_rate,
p_sys->fmt.audio.i_bitrate / 8 / 1024,
p_sys->fmt.i_bitrate / 8 / 1024,
p_sys->fmt.audio.i_blockalign,
p_sys->fmt.audio.i_bitspersample,
p_sys->fmt.i_extra );
......
......@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: input.c,v 1.255 2003/11/16 21:07:31 gbazin Exp $
* $Id: input.c,v 1.256 2003/11/16 22:54:11 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -1073,7 +1073,7 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
p_wf->wFormatTag = WAVE_FORMAT_UNKNOWN;
p_wf->nChannels = fmt->audio.i_channels;
p_wf->nSamplesPerSec = fmt->audio.i_rate;
p_wf->nAvgBytesPerSec = fmt->audio.i_bitrate / 8;
p_wf->nAvgBytesPerSec = fmt->i_bitrate / 8;
p_wf->nBlockAlign = fmt->audio.i_blockalign;
p_wf->wBitsPerSample = fmt->audio.i_bitspersample;
p_wf->cbSize = fmt->i_extra;
......@@ -1182,10 +1182,10 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
input_AddInfo( p_cat, _("Sample Rate"), "%d",
fmt->audio.i_rate );
}
if( fmt->audio.i_bitrate > 0 )
if( fmt->i_bitrate > 0 )
{
input_AddInfo( p_cat, _("Bitrate"), "%d",
fmt->audio.i_bitrate );
fmt->i_bitrate );
}
if( fmt->audio.i_bitspersample )
{
......
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