Commit ec49c1d3 authored by Qball Cow's avatar Qball Cow

Fix wavpack endian issues, tested to work for 16bit. (after blowing my ears off with white noise)

git-svn-id: https://svn.musicpd.org/mpd/trunk@6952 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent cb9d1b3d
......@@ -79,24 +79,41 @@ static void format_samples_int(int Bps, void *buffer, uint32_t samcnt)
break;
case 2:
while (samcnt--) {
*dst++ = (uchar)(temp = *src++);
temp = *src++;
#ifdef WORDS_BIGENDIAN
*dst++ = (uchar)(temp >> 8);
*dst++ = (uchar)(temp);
#else
*dst++ = (uchar)(temp);
*dst++ = (uchar)(temp >> 8);
#endif
}
break;
case 3:
/* downscale to 16 bits */
while (samcnt--) {
temp = *src++;
#ifdef WORDS_BIGENDIAN
*dst++ = (uchar)(temp >> 16);
*dst++ = (uchar)(temp >> 8);
#else
*dst++ = (uchar)(temp >> 8);
*dst++ = (uchar)(temp >> 16);
#endif
}
break;
case 4:
/* downscale to 16 bits */
while (samcnt--) {
temp = *src++;
#ifdef WORDS_BIGENDIAN
*dst++ = (uchar)(temp >> 24);
*dst++ = (uchar)(temp >> 16);
#else
*dst++ = (uchar)(temp >> 16);
*dst++ = (uchar)(temp >> 24);
#endif
}
break;
}
......
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