# HG changeset patch # User diego # Date 1145477521 0 # Node ID 710d4bc5f8c962058ab45f070860ebd6adee9d26 # Parent 163fe5c2577d6c873bbf1c9a100ea64886245055 Using channel count, samplerate and input bps values from the container instead of the decoder breaks some DTS samples where the container says the audio has 6 channels but the decoder gives 2. In this case take the number of channels from the decoder instead, the output will almost certainly be badly garbled anyway if the number of channels is wrong. patch by Uoti Urpala, uoti <<.>> urpala <<@>> pp1 <<.>> inet <<.>> fi diff -r 163fe5c2577d -r 710d4bc5f8c9 libmpcodecs/ad_ffmpeg.c --- a/libmpcodecs/ad_ffmpeg.c Wed Apr 19 15:58:10 2006 +0000 +++ b/libmpcodecs/ad_ffmpeg.c Wed Apr 19 20:12:01 2006 +0000 @@ -113,7 +113,8 @@ sh_audio->samplerate=lavc_context->sample_rate; sh_audio->i_bps=lavc_context->bit_rate/8; if(sh_audio->wf){ - sh_audio->channels=sh_audio->wf->nChannels; + // If the decoder uses the wrong number of channels all is lost anyway. + // sh_audio->channels=sh_audio->wf->nChannels; sh_audio->samplerate=sh_audio->wf->nSamplesPerSec; sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec; }