Commit 51348d69 authored by Max Kellermann's avatar Max Kellermann

mpc: fix broken integer sample conversion

The conversion of integer samples was completely broken, which presumably didn't annoy anybody because libmpcdec provides float samples on most installations.
parent ecd485ac
...@@ -74,12 +74,10 @@ static inline int16_t convertSample(MPC_SAMPLE_FORMAT sample) ...@@ -74,12 +74,10 @@ static inline int16_t convertSample(MPC_SAMPLE_FORMAT sample)
#ifdef MPC_FIXED_POINT #ifdef MPC_FIXED_POINT
const int shift = 16 - MPC_FIXED_POINT_SCALE_SHIFT; const int shift = 16 - MPC_FIXED_POINT_SCALE_SHIFT;
if (sample > 0) { if (shift < 0)
sample <<= shift; val = sample << -shift;
} else if (shift < 0) { else
sample >>= -shift; val = sample << shift;
}
val = sample;
#else #else
const int float_scale = 1 << (16 - 1); const int float_scale = 1 << (16 - 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment