Make OPUS_SET_GAIN survive decode reset.
This is the less-surprising behavior and will hopefully result in fewer corner case bugs (e.g. losing gain after seeking). This commit also updates the documentation.
This commit is contained in:
parent
9881484dbd
commit
03105f5b70
2 changed files with 3 additions and 2 deletions
|
@ -450,7 +450,8 @@ extern "C" {
|
||||||
/** Configures decoder gain adjustment.
|
/** Configures decoder gain adjustment.
|
||||||
* Scales the decoded output by a factor specified in Q8 dB units.
|
* Scales the decoded output by a factor specified in Q8 dB units.
|
||||||
* This has a maximum range of -32768 to 32767 inclusive, and returns
|
* This has a maximum range of -32768 to 32767 inclusive, and returns
|
||||||
* OPUS_BAD_ARG otherwise.
|
* OPUS_BAD_ARG otherwise. The default is zero indicating no adjustment.
|
||||||
|
* This setting survives decoder reset.
|
||||||
*
|
*
|
||||||
* gain = pow(10, x/(20.0*256))
|
* gain = pow(10, x/(20.0*256))
|
||||||
*
|
*
|
||||||
|
|
|
@ -53,6 +53,7 @@ struct OpusDecoder {
|
||||||
int channels;
|
int channels;
|
||||||
opus_int32 Fs; /** Sampling rate (at the API level) */
|
opus_int32 Fs; /** Sampling rate (at the API level) */
|
||||||
silk_DecControlStruct DecControl;
|
silk_DecControlStruct DecControl;
|
||||||
|
int decode_gain;
|
||||||
|
|
||||||
/* Everything beyond this point gets cleared on a reset */
|
/* Everything beyond this point gets cleared on a reset */
|
||||||
#define OPUS_DECODER_RESET_START stream_channels
|
#define OPUS_DECODER_RESET_START stream_channels
|
||||||
|
@ -63,7 +64,6 @@ struct OpusDecoder {
|
||||||
int prev_mode;
|
int prev_mode;
|
||||||
int frame_size;
|
int frame_size;
|
||||||
int prev_redundancy;
|
int prev_redundancy;
|
||||||
int decode_gain;
|
|
||||||
|
|
||||||
opus_uint32 rangeFinal;
|
opus_uint32 rangeFinal;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue