summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/metadata/mpc.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/apps/metadata/mpc.c b/apps/metadata/mpc.c
index 9894bb8b54..8db7993364 100644
--- a/apps/metadata/mpc.c
+++ b/apps/metadata/mpc.c
@@ -28,13 +28,8 @@
28#include "logf.h" 28#include "logf.h"
29#include "replaygain.h" 29#include "replaygain.h"
30 30
31#include "fixedpoint.h"
32#include <stdlib.h>
33#include <stdbool.h>
34#include <inttypes.h>
35
36/* Needed for replay gain in sv8, please search MPC_OLD_GAIN_REF in libmusepack */ 31/* Needed for replay gain in sv8, please search MPC_OLD_GAIN_REF in libmusepack */
37#define SV8_TO_SV7_CONVERT_GAIN (64.82*100) 32#define SV8_TO_SV7_CONVERT_GAIN (6482) /* 64.82 * 100 */
38 33
39static int set_replaygain_sv7(struct mp3entry* id3, 34static int set_replaygain_sv7(struct mp3entry* id3,
40 bool album, 35 bool album,
@@ -66,7 +61,7 @@ static int set_replaygain_sv8(struct mp3entry* id3,
66 long peak, 61 long peak,
67 long used) 62 long used)
68{ 63{
69 gain = (long)(SV8_TO_SV7_CONVERT_GAIN - (gain*100./256.)); 64 gain = (long)(SV8_TO_SV7_CONVERT_GAIN - ((gain*100)/256));
70 65
71 /* We use a peak value of 0 to indicate a given gain type isn't used. */ 66 /* We use a peak value of 0 to indicate a given gain type isn't used. */
72 if (peak != 0) { 67 if (peak != 0) {