SWCODEC: Fix the problem of replaygain not being applied unless the menu is entered. Make all codecs set the replay gain or else formats that do not have replaygain will not set the gain back to default if a file with gain applied proceeded them.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12498 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
94c02493a9
commit
9b9e22731c
9 changed files with 24 additions and 6 deletions
|
@ -134,8 +134,9 @@ next_track:
|
|||
|
||||
while (!ci->taginfo_ready)
|
||||
ci->yield();
|
||||
|
||||
|
||||
ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency);
|
||||
codec_set_replaygain(ci->id3);
|
||||
|
||||
/* Intialise the A52 decoder and check for success */
|
||||
state = a52_init(0);
|
||||
|
|
|
@ -70,6 +70,8 @@ next_track:
|
|||
/* wait for track info to load */
|
||||
while (!*ci->taginfo_ready && !ci->stop_codec)
|
||||
ci->sleep(1);
|
||||
|
||||
codec_set_replaygain(ci->id3);
|
||||
|
||||
/* Read the entire file (or as much as possible) */
|
||||
DEBUGF("ADX: request initial buffer\n");
|
||||
|
|
|
@ -75,6 +75,8 @@ next_track:
|
|||
|
||||
while (!*ci->taginfo_ready)
|
||||
ci->yield();
|
||||
|
||||
codec_set_replaygain(ci->id3);
|
||||
|
||||
/* assume the AIFF header is less than 1024 bytes */
|
||||
buf = ci->request_buffer(&n, 1024);
|
||||
|
|
|
@ -4344,6 +4344,8 @@ next_track:
|
|||
/* wait for track info to load */
|
||||
while (!*ci->taginfo_ready && !ci->stop_codec)
|
||||
ci->sleep(1);
|
||||
|
||||
codec_set_replaygain(ci->id3);
|
||||
|
||||
/* Read the entire file */
|
||||
DEBUGF("NSF: request file\n");
|
||||
|
|
|
@ -61,6 +61,8 @@ next_track:
|
|||
while (!*ci->taginfo_ready)
|
||||
ci->yield();
|
||||
|
||||
codec_set_replaygain(ci->id3);
|
||||
|
||||
/* Shorten decoder initialization */
|
||||
ci->memset(&sc, 0, sizeof(ShortenContext));
|
||||
|
||||
|
|
|
@ -1226,6 +1226,8 @@ next_track:
|
|||
|
||||
while (!*ci->taginfo_ready)
|
||||
ci->yield();
|
||||
|
||||
codec_set_replaygain(ci->id3);
|
||||
|
||||
/* Load SID file */
|
||||
p = sidfile;
|
||||
|
|
|
@ -829,6 +829,8 @@ enum codec_status codec_main(void)
|
|||
while (!*ci->taginfo_ready && !ci->stop_codec)
|
||||
ci->sleep(1);
|
||||
|
||||
codec_set_replaygain(ci->id3);
|
||||
|
||||
/* Read the entire file */
|
||||
DEBUGF("SPC: request initial buffer\n");
|
||||
ci->configure(CODEC_SET_FILEBUF_WATERMARK, ci->filesize);
|
||||
|
|
|
@ -237,6 +237,8 @@ next_track:
|
|||
|
||||
while (!*ci->taginfo_ready && !ci->stop_codec)
|
||||
ci->sleep(1);
|
||||
|
||||
codec_set_replaygain(ci->id3);
|
||||
|
||||
/* Need to save offset for later use (cleared indirectly by advance_buffer) */
|
||||
bytesdone = ci->id3->offset;
|
||||
|
|
13
apps/dsp.c
13
apps/dsp.c
|
@ -1200,11 +1200,14 @@ bool dsp_configure(int setting, intptr_t value)
|
|||
void set_gain_var(long *var, long value)
|
||||
{
|
||||
/* Voice shouldn't mess with these */
|
||||
if (dsp != audio_dsp)
|
||||
return;
|
||||
|
||||
*var = value;
|
||||
new_gain = true;
|
||||
if (dsp == audio_dsp)
|
||||
{
|
||||
*var = value;
|
||||
/* In case current gain is zero, force at least one call
|
||||
to apply_gain or apply_gain won't pick up on new_gain */
|
||||
audio_dsp->gain = -1;
|
||||
new_gain = true;
|
||||
}
|
||||
}
|
||||
|
||||
void update_functions(void)
|
||||
|
|
Loading…
Reference in a new issue