Browse Source

audiotrack: save original volume

In order to re-apply the gain > 1.f when audiotrack is restarted.
Fixes #25833
Thomas Guillem 6 years ago
committed by Alexandre Janniaux
parent
commit
446a5db421
  1. 11
      modules/audio_output/audiotrack.c

11
modules/audio_output/audiotrack.c

@ -2142,21 +2142,20 @@ VolumeSet( audio_output_t *p_aout, float volume )
JNIEnv *env;
float gain = 1.0f;
p_sys->volume = volume;
if (volume > 1.f)
{
p_sys->volume = 1.f;
gain = volume;
gain = volume * volume * volume;
volume = 1.f;
}
else
p_sys->volume = volume;
if( !p_sys->b_error && p_sys->p_audiotrack != NULL && ( env = GET_ENV() ) )
{
AudioTrack_SetVolume( env, p_aout, volume );
}
aout_VolumeReport(p_aout, volume);
aout_GainRequest(p_aout, gain * gain * gain);
aout_VolumeReport(p_aout, p_sys->volume);
aout_GainRequest(p_aout, gain);
return 0;
}

Loading…
Cancel
Save