From: Josh Coalson Date: Wed, 30 Oct 2002 06:24:41 +0000 (+0000) Subject: use replaygain lib's peak analysis X-Git-Tag: 1.2.0~1399 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9fc490483d2d4f1c002ab1e3df6a876dc690ce57;p=platform%2Fupstream%2Fflac.git use replaygain lib's peak analysis --- diff --git a/src/metaflac/main.c b/src/metaflac/main.c index c5e9163..5cfe2d9 100644 --- a/src/metaflac/main.c +++ b/src/metaflac/main.c @@ -1643,7 +1643,7 @@ FLAC__bool do_shorthand_operation__add_replay_gain(char **filenames, unsigned nu { FLAC__StreamMetadata streaminfo; float *title_gains = 0, *title_peaks = 0; - float album_gain = 0.0, album_peak = 0.0; + float album_gain, album_peak; unsigned sample_rate = 0; unsigned bits_per_sample = 0; unsigned channels = 0; @@ -1706,10 +1706,8 @@ FLAC__bool do_shorthand_operation__add_replay_gain(char **filenames, unsigned nu free(title_peaks); return false; } - if(title_peaks[i] > album_peak) - album_peak = title_peaks[i]; } - album_gain = FLAC__replaygain_get_album_gain(); + FLAC__replaygain_get_album(&album_gain, &album_peak); for(i = 0; i < num_files; i++) { if(0 != (error = FLAC__replaygain_store_to_file(filenames[i], album_gain, album_peak, title_gains[i], title_peaks[i], preserve_modtime))) {