summaryrefslogtreecommitdiff
path: root/apps/dsp.c
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2006-11-15 20:26:33 +0000
committerMagnus Holmgren <magnushol@gmail.com>2006-11-15 20:26:33 +0000
commitea7992455a9704e2eb6bd6c9b39fabd111a7b997 (patch)
tree44e4f25d4e21b4686e682754b1f3fbef2fcfe03f /apps/dsp.c
parent442c0e663f20dfd64e6d7d818ab13f444804ab5e (diff)
downloadrockbox-ea7992455a9704e2eb6bd6c9b39fabd111a7b997.zip
rockbox-ea7992455a9704e2eb6bd6c9b39fabd111a7b997.tar.gz
rockbox-ea7992455a9704e2eb6bd6c9b39fabd111a7b997.tar.bz2
rockbox-ea7992455a9704e2eb6bd6c9b39fabd111a7b997.tar.xz
Make the updated %rg tag match playback behaviour (fall back to track gain if album gain requested but not available). Share the mode decision logic with playback code and simplify the %rg tag handling.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11532 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/dsp.c')
-rw-r--r--apps/dsp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/dsp.c b/apps/dsp.c
index 94e825c..5627b05 100644
--- a/apps/dsp.c
+++ b/apps/dsp.c
@@ -26,6 +26,7 @@
#include "system.h"
#include "settings.h"
#include "replaygain.h"
+#include "misc.h"
#include "debug.h"
#ifndef SIMULATOR
@@ -1093,10 +1094,8 @@ void dsp_set_replaygain(bool always)
if (global_settings.replaygain || global_settings.replaygain_noclip)
{
- bool track_mode
- = ((global_settings.replaygain_type == REPLAYGAIN_TRACK)
- || ((global_settings.replaygain_type == REPLAYGAIN_SHUFFLE)
- && global_settings.playlist_shuffle));
+ bool track_mode = get_replaygain_mode(dsp->track_gain != 0,
+ dsp->album_gain != 0) == REPLAYGAIN_TRACK;
long peak = (track_mode || !dsp->album_peak)
? dsp->track_peak : dsp->album_peak;