From: Aoi S. <shi...@gm...> - 2010-01-09 15:36:14
|
Hi all. I have LCPM 24bit DVD. When I played it on xine, Sound was noisy noise. And I found that LCPM 24bit byte stream is _not_ the same as WAVE 24bit byte stream. # Under LCPM 24bit byte stream, # 12byte is one chunk and [8] [9] [10] [11] is highest byte (16bit-23bit)... The following is the patch for xine-lib-1.1.16.3. But newest version has the same problem. I tested this patch on i386 (32bit little endian arch). Signed-off-by: Aoi Shinkai <shi...@gm...> --- xine-lib-1.1.16.3/src/libxineadec/xine_lpcm_decoder.c.orig 2009-02-11 02:32:23.000000000 +0900 +++ xine-lib-1.1.16.3/src/libxineadec/xine_lpcm_decoder.c 2010-01-09 23:28:14.000000000 +0900 @@ -192,29 +192,33 @@ static void lpcm_decode_data (audio_deco uint8_t *d = (uint8_t *)audio_buffer->mem; int n = buf->size; - while (n >= 3) { + while (n >= 12) { if ( stream_be ) { - if ( stream_be == this->cpu_be ) { - *d++ = s[0]; - *d++ = s[1]; - } else { - *d++ = s[1]; - *d++ = s[0]; - } + if ( stream_be == this->cpu_be ) { + *d++ = s[0]; + *d++ = s[1]; + *d++ = s[2]; + *d++ = s[3]; + *d++ = s[4]; + *d++ = s[5]; + *d++ = s[6]; + *d++ = s[7]; + } else { + *d++ = s[1]; + *d++ = s[0]; + *d++ = s[3]; + *d++ = s[2]; + *d++ = s[5]; + *d++ = s[4]; + *d++ = s[7]; + *d++ = s[6]; + } } else { - if ( stream_be == this->cpu_be ) { - *d++ = s[1]; - *d++ = s[2]; - } - else - { - *d++ = s[2]; - *d++ = s[1]; - } + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "lpcm_decoder: I don't know what should decode lpcm 24bit little endian byte stream"); } - s += 3; - n -= 3; + s += 12; + n -= 12; } if ( (d - (uint8_t*)audio_buffer->mem)/2*3 < buf->size ) |