]> git.sesse.net Git - vlc/commitdiff
* ALL: moved i_bitrate out of audio_format_t into es_format_t
authorGildas Bazin <gbazin@videolan.org>
Sun, 16 Nov 2003 22:54:12 +0000 (22:54 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 16 Nov 2003 22:54:12 +0000 (22:54 +0000)
12 files changed:
include/audio_output.h
modules/codec/a52.c
modules/codec/dts.c
modules/codec/mpeg_audio.c
modules/codec/vorbis.c
modules/demux/asf/asf.c
modules/demux/au.c
modules/demux/avi/avi.c
modules/demux/mkv.cpp
modules/demux/mpeg/mpga.c
modules/demux/wav.c
src/input/input.c

index 98820eadac78511791ea54e9982e9ee00ee3b086..38035b0d6b88da466eaa15b66b727bae03546d68 100644 (file)
@@ -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;
index 7f6b1f1446d017b676113431e684c833ea467967..65919c43974bffbcc24bb903076981f0462ed496 100644 (file)
@@ -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: Stéphane 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 );
index 45e72f606edc6e3d523d1d7ef018e2aef471a6c9..982f013fb75d194b36684dce48112c67b09411a2 100644 (file)
@@ -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 );
index 8918ff68a1a2edaabdd3dc96b5f415f9ec4ca3de..0aafe67b533d288c656179609823febc9fde86ed 100644 (file)
@@ -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 );
index a998aba5947bdd28fe48575e555a06f8c3b6e3a8..072ea11fe2c20dc91f416717410c2af44e50509a 100644 (file)
@@ -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 );
 
index 3cdd6a458e7f6bed27881ed81512b3a5cc5a34e4..94f98ab19afbc357627e4f5c7d0a38f9b1d72f72 100644 (file)
@@ -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] );
 
index ee1a7182c0c29ddcaaf1261d50cf0ac391c480fe..df81c1612af5651d87aa92fc835d8e5374160cd6 100644 (file)
@@ -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 );
index 2d686c6405422a9a1f52381ea24049962371d2ce..d1602a2dcce49269ceca06548d9e0008216b330d 100644 (file)
@@ -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,
index a11c5b926863222c84d9e01841502f667cc95042..5f1c7e21c7fb6731e18d154762c04e641bbd89ee 100644 (file)
@@ -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 );
 
index 3b603bd90d5cd0ec5db34808fd5c07a412010b7c..ca40e28d3aa70765d04b062d83643dc4e8b80cf6 100644 (file)
@@ -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 );
index c9a65d5ca4e6a3b851d165011e831930dec5a247..5baaf7a4a0db66846499643f9183b0c7c30a8291 100644 (file)
@@ -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 );
index 7fa827c8a6be2fe6be59cbe06382ffe76cddf87c..1f1e9b2be0ed38dbf15b01605424663656b3d6e5 100644 (file)
@@ -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 )
                 {