aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/mp3_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-11 16:24:27 +0100
committerMax Kellermann <max@duempel.org>2008-11-11 16:24:27 +0100
commit5ddde0aac790c57b75f20ce71e100f4379f1c653 (patch)
treeb2e8ec4a99e032bf894002fd436c00e35e3cf5fd /src/decoder/mp3_plugin.c
parent5e686add91a7c2a89b886d04136983480793a26f (diff)
downloadmpd-5ddde0aac790c57b75f20ce71e100f4379f1c653.tar.gz
mpd-5ddde0aac790c57b75f20ce71e100f4379f1c653.tar.xz
mpd-5ddde0aac790c57b75f20ce71e100f4379f1c653.zip
replay_gain: converted struct replay_gain_info elements to an array
Having an array instead of individual variables allows the use of the replay_gain_mode enum as an array index.
Diffstat (limited to 'src/decoder/mp3_plugin.c')
-rw-r--r--src/decoder/mp3_plugin.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/decoder/mp3_plugin.c b/src/decoder/mp3_plugin.c
index 602c9e2f9..4ae6cd744 100644
--- a/src/decoder/mp3_plugin.c
+++ b/src/decoder/mp3_plugin.c
@@ -228,16 +228,16 @@ parse_id3_replay_gain_info(struct id3_tag *tag)
(&frame->fields[2]));
if (strcasecmp(key, "replaygain_track_gain") == 0) {
- replay_gain_info->track_gain = atof(value);
+ replay_gain_info->tuples[REPLAY_GAIN_TRACK].gain = atof(value);
found = true;
} else if (strcasecmp(key, "replaygain_album_gain") == 0) {
- replay_gain_info->album_gain = atof(value);
+ replay_gain_info->tuples[REPLAY_GAIN_ALBUM].gain = atof(value);
found = true;
} else if (strcasecmp(key, "replaygain_track_peak") == 0) {
- replay_gain_info->track_peak = atof(value);
+ replay_gain_info->tuples[REPLAY_GAIN_TRACK].peak = atof(value);
found = true;
} else if (strcasecmp(key, "replaygain_album_peak") == 0) {
- replay_gain_info->album_peak = atof(value);
+ replay_gain_info->tuples[REPLAY_GAIN_ALBUM].peak = atof(value);
found = true;
}
@@ -761,8 +761,8 @@ mp3_decode_first_frame(struct mp3_data *data, struct tag **tag,
if (replay_gain_info_r && !*replay_gain_info_r &&
lame.track_gain) {
*replay_gain_info_r = replay_gain_info_new();
- (*replay_gain_info_r)->track_gain = lame.track_gain;
- (*replay_gain_info_r)->track_peak = lame.peak;
+ (*replay_gain_info_r)->tuples[REPLAY_GAIN_TRACK].gain = lame.track_gain;
+ (*replay_gain_info_r)->tuples[REPLAY_GAIN_TRACK].peak = lame.peak;
}
}
}