# HG changeset patch # User Eugene Zagidullin # Date 1202265686 -10800 # Node ID 5298b10777b364bd94d0576fbdbb8ac6ccd06f15 # Parent 5eb15f6cf71ef39b535ad32a7f05f1c91f0f5e83 peak == 0 mean absence of gain/peak pair diff -r 5eb15f6cf71e -r 5298b10777b3 src/madplug_x/input.c --- a/src/madplug_x/input.c Tue Feb 05 09:14:14 2008 +0300 +++ b/src/madplug_x/input.c Wed Feb 06 05:41:26 2008 +0300 @@ -88,8 +88,10 @@ info->filename = g_strdup(url); // from input_read_replaygain() - info->replaygain_album_scale = -1; - info->replaygain_track_scale = -1; + info->replaygain_track_peak = 0.0; + info->replaygain_track_scale = 0.0; + info->replaygain_album_peak = 0.0; + info->replaygain_album_scale = 0.0; info->mp3gain_undo = -77; info->mp3gain_minmax = -77; diff -r 5eb15f6cf71e -r 5298b10777b3 src/madplug_x/plugin.c --- a/src/madplug_x/plugin.c Tue Feb 05 09:14:14 2008 +0300 +++ b/src/madplug_x/plugin.c Wed Feb 06 05:41:26 2008 +0300 @@ -418,6 +418,11 @@ rg_info.track_peak = info.replaygain_track_peak; rg_info.album_gain = info.replaygain_album_scale; rg_info.album_peak = info.replaygain_album_peak; + AUDDBG("Replay Gain info:\n"); + AUDDBG("* track gain: %+f dB\n", rg_info.track_gain); + AUDDBG("* track peak: %f\n", rg_info.track_peak); + AUDDBG("* album gain: %+f dB\n", rg_info.album_gain); + AUDDBG("* album peak: %f\n", rg_info.album_peak); playback->set_replaygain_info(playback, &rg_info); g_mutex_lock(pb_mutex); diff -r 5eb15f6cf71e -r 5298b10777b3 src/madplug_x/plugin.h --- a/src/madplug_x/plugin.h Tue Feb 05 09:14:14 2008 +0300 +++ b/src/madplug_x/plugin.h Wed Feb 06 05:41:26 2008 +0300 @@ -77,13 +77,12 @@ gchar *prev_title; /* used to optimize set_info calls */ /* replay parameters */ - gboolean has_replaygain; - double replaygain_album_scale; // -1 if not set + double replaygain_album_scale; double replaygain_track_scale; gchar *replaygain_album_str; gchar *replaygain_track_str; - double replaygain_album_peak; // -1 if not set - double replaygain_track_peak; + double replaygain_album_peak; /* 0 if gain/peak pair not set */ + double replaygain_track_peak; /* 0 if gain/peak pair not set */ gchar *replaygain_album_peak_str; gchar *replaygain_track_peak_str; double mp3gain_undo; // -1 if not set diff -r 5eb15f6cf71e -r 5298b10777b3 src/madplug_x/replaygain.c --- a/src/madplug_x/replaygain.c Tue Feb 05 09:14:14 2008 +0300 +++ b/src/madplug_x/replaygain.c Wed Feb 06 05:41:26 2008 +0300 @@ -247,12 +247,6 @@ free(value); } - if (file_info->replaygain_track_scale != -1 || file_info->replaygain_album_scale != -1) - { - file_info->has_replaygain = TRUE; - return 1; - } - return 0; } @@ -264,9 +258,10 @@ AUDDBG("f: read_replaygain\n"); - file_info->has_replaygain = FALSE; - file_info->replaygain_album_scale = -1; - file_info->replaygain_track_scale = -1; + file_info->replaygain_track_peak = 0.0; + file_info->replaygain_track_scale = 0.0; + file_info->replaygain_album_peak = 0.0; + file_info->replaygain_album_scale = 0.0; file_info->mp3gain_undo = -77; file_info->mp3gain_minmax = -77; @@ -336,10 +331,6 @@ } #endif - if (file_info->replaygain_album_scale != -1 - || file_info->replaygain_track_scale != -1) - file_info->has_replaygain = TRUE; - if (file_info->infile) aud_vfs_fseek(fp, curpos, SEEK_SET);