diff options
author | Gregory Maxwell <greg@xiph.org> | 2012-07-11 08:04:24 +0400 |
---|---|---|
committer | Gregory Maxwell <greg@xiph.org> | 2012-07-11 08:04:24 +0400 |
commit | 28b41ae5ae1acf6eb222858567952564838d48f5 (patch) | |
tree | 4f9f1c48748f499c8730515ca5b9b1c0633324d3 /src/opus_multistream.c | |
parent | c329045758ccd614284f0b7cca859bc046ba1ae3 (diff) |
Add OPUS_{GET|SET}_GAIN CTLs for adjusting output gain.
This CTL was requested by Nicolas George for FFmpeg.
Diffstat (limited to 'src/opus_multistream.c')
-rw-r--r-- | src/opus_multistream.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/opus_multistream.c b/src/opus_multistream.c index b593bf32..1128c07e 100644 --- a/src/opus_multistream.c +++ b/src/opus_multistream.c @@ -845,7 +845,27 @@ int opus_multistream_decoder_ctl(OpusMSDecoder *st, int request, ...) } *value = (OpusDecoder*)ptr; } - break; + break; + case OPUS_SET_GAIN_REQUEST: + { + int s; + /* This works for int32 params */ + opus_int32 value = va_arg(ap, opus_int32); + for (s=0;s<st->layout.nb_streams;s++) + { + OpusDecoder *dec; + + dec = (OpusDecoder*)ptr; + if (s < st->layout.nb_coupled_streams) + ptr += align(coupled_size); + else + ptr += align(mono_size); + ret = opus_decoder_ctl(dec, request, value); + if (ret != OPUS_OK) + break; + } + } + break; default: ret = OPUS_UNIMPLEMENTED; break; |