diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/xine-engine/audio_out.c | 28 | ||||
-rw-r--r-- | src/xine-engine/audio_out.h | 3 | ||||
-rw-r--r-- | src/xine-engine/xine_interface.c | 12 |
3 files changed, 36 insertions, 7 deletions
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index e173dfee0..28d6b5568 100644 --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -17,7 +17,7 @@ * along with self program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_out.c,v 1.111 2003/03/08 17:24:22 mroi Exp $ + * $Id: audio_out.c,v 1.112 2003/03/08 20:25:52 guenter Exp $ * * 22-8-2001 James imported some useful AC3 sections from the previous alsa driver. * (c) 2001 Andy Lo A Foe <andy@alsaplayer.org> @@ -181,6 +181,7 @@ typedef struct { int do_compress; double compression_factor; /* current compression */ double compression_factor_max; /* user limit on compression */ + double amp_factor; } aos_t; @@ -388,7 +389,7 @@ static int mode_channels( int mode ) { return 0; } -static void audio_filter_compress (aos_t *this, int16_t *mem, int num_frames) { +static void audio_filter_amp_compress (aos_t *this, int16_t *mem, int num_frames) { int i, maxs; double f_max; @@ -432,7 +433,7 @@ static void audio_filter_compress (aos_t *this, int16_t *mem, int num_frames) { /* 0.98 to avoid overflow */ - mem[i] = mem[i] * 0.98 * this->compression_factor; + mem[i] = mem[i] * 0.98 * this->compression_factor * this->amp_factor; } } @@ -445,7 +446,7 @@ static audio_buffer_t* prepare_samples( aos_t *this, audio_buffer_t *buf) { */ if ( this->do_compress && (this->input.bits == 16)) - audio_filter_compress (this, buf->mem, buf->num_frames); + audio_filter_amp_compress (this, buf->mem, buf->num_frames); /* * resample and output audio data @@ -1343,6 +1344,10 @@ static int ao_get_property (xine_audio_port_t *this_gen, int property) { ret = this->compression_factor_max*100; break; + case AO_PROP_AMP: + ret = this->amp_factor*100; + break; + case AO_PROP_DISCARD_BUFFERS: ret = this->discard_buffers; break; @@ -1367,11 +1372,23 @@ static int ao_set_property (xine_audio_port_t *this_gen, int property, int value case AO_PROP_COMPRESSOR: this->compression_factor_max = (double) value / 100.0; - this->do_compress = (this->compression_factor_max >1.0); + + this->do_compress = (this->compression_factor_max >1.0) + || (this->amp_factor != 1.0); ret = this->compression_factor_max*100; break; + case AO_PROP_AMP: + + this->amp_factor = (double) value / 100.0; + + this->do_compress = (this->compression_factor_max >1.0) + || (this->amp_factor != 1.0); + + ret = this->amp_factor*100; + break; + case AO_PROP_DISCARD_BUFFERS: /* recursive discard buffers setting */ if(value) @@ -1543,6 +1560,7 @@ xine_audio_port_t *ao_new_port (xine_t *xine, ao_driver_t *driver, this->compression_factor = 1.0; this->compression_factor_max = 4.0; + this->amp_factor = 1.0; this->do_compress = 0; /* diff --git a/src/xine-engine/audio_out.h b/src/xine-engine/audio_out.h index 3c9379ca0..79f330afe 100644 --- a/src/xine-engine/audio_out.h +++ b/src/xine-engine/audio_out.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_out.h,v 1.52 2003/02/07 17:28:10 mroi Exp $ + * $Id: audio_out.h,v 1.53 2003/03/08 20:25:52 guenter Exp $ */ #ifndef HAVE_AUDIO_OUT_H #define HAVE_AUDIO_OUT_H @@ -294,6 +294,7 @@ xine_audio_port_t *ao_new_port (xine_t *xine, ao_driver_t *driver, int grab_only #define AO_PROP_COMPRESSOR 3 #define AO_PROP_DISCARD_BUFFERS 4 #define AO_PROP_PAUSED 5 +#define AO_PROP_AMP 6 /* amplifier */ /* audio device control ops */ #define AO_CTRL_PLAY_PAUSE 0 diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c index bc989efc6..430776782 100644 --- a/src/xine-engine/xine_interface.c +++ b/src/xine-engine/xine_interface.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_interface.c,v 1.44 2003/03/08 17:22:16 f1rmb Exp $ + * $Id: xine_interface.c,v 1.45 2003/03/08 20:25:52 guenter Exp $ * * convenience/abstraction layer, functions to implement * libxine's public interface @@ -369,6 +369,11 @@ void xine_set_param (xine_stream_t *stream, int param, int value) { stream->audio_out->set_property (stream->audio_out, AO_PROP_COMPRESSOR, value); break; + case XINE_PARAM_AUDIO_AMP_LEVEL: + if (stream->audio_out) + stream->audio_out->set_property (stream->audio_out, AO_PROP_AMP, value); + break; + case XINE_PARAM_VERBOSITY: stream->xine->verbosity = value; @@ -438,6 +443,11 @@ int xine_get_param (xine_stream_t *stream, int param) { return -1; return stream->audio_out->get_property (stream->audio_out, AO_PROP_COMPRESSOR); + case XINE_PARAM_AUDIO_AMP_LEVEL: + if (!stream->audio_out) + return -1; + return stream->audio_out->get_property (stream->audio_out, AO_PROP_AMP); + case XINE_PARAM_VERBOSITY: return stream->xine->verbosity; |