Opus input: Support switching gain modes based on player settings, since the Opus tag reader doesn't support Opus gain tags yet
This commit is contained in:
parent
8e5c62f185
commit
6b8d300384
1 changed files with 11 additions and 0 deletions
|
@ -90,6 +90,17 @@ opus_int64 sourceTell(void *_stream)
|
||||||
|
|
||||||
totalFrames = op_pcm_total(opusRef, -1);
|
totalFrames = op_pcm_total(opusRef, -1);
|
||||||
|
|
||||||
|
NSString * gainMode = [[NSUserDefaults standardUserDefaults] stringForKey:@"volumeScaling"];
|
||||||
|
BOOL isAlbum = [gainMode hasPrefix:@"albumGain"];
|
||||||
|
BOOL isTrack = [gainMode hasPrefix:@"trackGain"];
|
||||||
|
|
||||||
|
if (isAlbum || isTrack) {
|
||||||
|
op_set_gain_offset(opusRef, isAlbum ? OP_HEADER_GAIN : OP_TRACK_GAIN, 0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
op_set_gain_offset(opusRef, OP_ABSOLUTE_GAIN, 0);
|
||||||
|
}
|
||||||
|
|
||||||
[self willChangeValueForKey:@"properties"];
|
[self willChangeValueForKey:@"properties"];
|
||||||
[self didChangeValueForKey:@"properties"];
|
[self didChangeValueForKey:@"properties"];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue