]> git.sesse.net Git - vlc/commitdiff
* Added an option to disable the dynamic range compression.
authorGildas Bazin <gbazin@videolan.org>
Mon, 20 May 2002 15:03:33 +0000 (15:03 +0000)
committerGildas Bazin <gbazin@videolan.org>
Mon, 20 May 2002 15:03:33 +0000 (15:03 +0000)
ChangeLog
plugins/a52/a52.c
plugins/a52/a52.h

index 1188610f4d5fa473633f423b8f45968e1f5e5f15..8bb0c5394260dfc3bd05309bffb3e345e01b3055 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,8 @@
 
 HEAD
 
+  * ./plugins/a52/a52.c: added an option to disable the dynamic range
+    compression.
   * ./Makefile.opts.in: removed configuration stuff which does not need to
     rebuild anything to Makefile.config, so that editing it will not cause
     a complete rebuild.
index dfb49067ad7903f2c5e792a93f90390765d6ce61..55ca6a2ee34e8ffe29a23568f762881b195fed2b 100644 (file)
@@ -4,7 +4,7 @@
  *   (http://liba52.sf.net/).
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: a52.c,v 1.10 2002/05/18 17:47:46 sam Exp $
+ * $Id: a52.c,v 1.11 2002/05/20 15:03:32 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *      
@@ -72,7 +72,17 @@ void _M( adec_getfunctions )( function_list_t * p_function_list )
 /*****************************************************************************
  * Build configuration structure.
  *****************************************************************************/
+#define DYNRNG_TEXT N_("disable A/52 dynamic range compression")
+#define DYNRNG_LONGTEXT N_( \
+    "Dynamic range compression makes the loud sounds softer, and the soft " \
+    "sounds louder, so you can more easily listen to the stream in a noisy " \
+    "environment without disturbing anyone.\nIf you disable the dynamic range"\
+    " compression the playback will be more adapted to a movie theater or a " \
+    "listening room.")
+
 MODULE_CONFIG_START
+ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
+ADD_BOOL    ( "a52-no-dynrng", NULL, DYNRNG_TEXT, DYNRNG_LONGTEXT )
 MODULE_CONFIG_STOP
 
 MODULE_INIT_START
@@ -198,6 +208,8 @@ static int InitThread( a52_adec_thread_t * p_a52_adec )
         return -1;
     }
 
+    p_a52_adec->b_dynrng = !config_GetIntVariable( "a52-no-dynrng" );
+
     /* Init the BitStream */
     InitBitstream( &p_a52_adec->bit_stream,
                    p_a52_adec->p_fifo,
@@ -272,6 +284,9 @@ static int DecodeFrame( a52_adec_thread_t * p_a52_adec )
     a52_frame( p_a52_adec->p_a52_state, p_a52_adec->p_frame_buffer,
                &p_a52_adec->flags, &sample_level, 384 );
 
+    if( !p_a52_adec->b_dynrng )
+        a52_dynrng( p_a52_adec->p_a52_state, NULL, NULL );
+
     for( i = 0; i < 6; i++ )
     {
         if( a52_block( p_a52_adec->p_a52_state ) )
index cc1ac5f6c7424dda8d211cdf3922dbf7d55dc949..0782628d8fabed98163e5dceaf6263f8e41aa52a 100644 (file)
@@ -4,7 +4,7 @@
  *   (http://liba52.sf.net/).
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: a52.h,v 1.2 2002/03/12 20:39:50 gbazin Exp $
+ * $Id: a52.h,v 1.3 2002/05/20 15:03:33 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *      
@@ -36,6 +36,7 @@ typedef struct a52_adec_thread_s
     int         flags;
     int         sample_rate;
     int         bit_rate;
+    boolean_t   b_dynrng;
 
     /* The bit stream structure handles the PES stream at the bit level */
     bit_stream_t        bit_stream;