msg711: Correct wave format parameters to remove stuttering.

This commit is contained in:
Jörg Höhle 2009-11-10 22:45:06 +01:00 committed by Alexandre Julliard
parent efda021c5d
commit 7630a6f0dc
1 changed files with 9 additions and 9 deletions

View File

@ -832,16 +832,16 @@ static LRESULT G711_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
switch (adfs->pwfxDst->wFormatTag) switch (adfs->pwfxDst->wFormatTag)
{ {
case WAVE_FORMAT_PCM: case WAVE_FORMAT_PCM:
adfs->pwfxDst->nBlockAlign = adfs->pwfxDst->nChannels; adfs->pwfxDst->nBlockAlign = adfs->pwfxDst->nChannels * 2;
adfs->pwfxDst->nAvgBytesPerSec = adfs->pwfxDst->nSamplesPerSec * adfs->pwfxDst->nBlockAlign; adfs->pwfxDst->nAvgBytesPerSec = adfs->pwfxDst->nSamplesPerSec * adfs->pwfxDst->nBlockAlign;
break; break;
case WAVE_FORMAT_ALAW: case WAVE_FORMAT_ALAW:
adfs->pwfxDst->nBlockAlign = adfs->pwfxDst->nChannels * 2; adfs->pwfxDst->nBlockAlign = adfs->pwfxDst->nChannels;
adfs->pwfxDst->nAvgBytesPerSec = adfs->pwfxDst->nSamplesPerSec * adfs->pwfxSrc->nChannels * 2; adfs->pwfxDst->nAvgBytesPerSec = adfs->pwfxDst->nSamplesPerSec * adfs->pwfxSrc->nChannels;
break; break;
case WAVE_FORMAT_MULAW: case WAVE_FORMAT_MULAW:
adfs->pwfxDst->nBlockAlign = adfs->pwfxDst->nChannels * 2; adfs->pwfxDst->nBlockAlign = adfs->pwfxDst->nChannels;
adfs->pwfxDst->nAvgBytesPerSec = adfs->pwfxDst->nSamplesPerSec * adfs->pwfxSrc->nChannels * 2; adfs->pwfxDst->nAvgBytesPerSec = adfs->pwfxDst->nSamplesPerSec * adfs->pwfxSrc->nChannels;
break; break;
default: default:
FIXME("\n"); FIXME("\n");
@ -993,13 +993,13 @@ static LRESULT G711_StreamSize(const ACMDRVSTREAMINSTANCE *adsi, PACMDRVSTREAMSI
(adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ALAW || (adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ALAW ||
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_MULAW)) adsi->pwfxDst->wFormatTag == WAVE_FORMAT_MULAW))
{ {
adss->cbSrcLength = adss->cbDstLength / 2; adss->cbSrcLength = adss->cbDstLength * 2;
} }
else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ALAW || else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ALAW ||
adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MULAW) && adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MULAW) &&
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM)
{ {
adss->cbSrcLength = adss->cbDstLength * 2; adss->cbSrcLength = adss->cbDstLength / 2;
} }
else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ALAW || else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ALAW ||
adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MULAW) && adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MULAW) &&
@ -1019,13 +1019,13 @@ static LRESULT G711_StreamSize(const ACMDRVSTREAMINSTANCE *adsi, PACMDRVSTREAMSI
(adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ALAW || (adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ALAW ||
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_MULAW)) adsi->pwfxDst->wFormatTag == WAVE_FORMAT_MULAW))
{ {
adss->cbDstLength = adss->cbSrcLength * 2; adss->cbDstLength = adss->cbSrcLength / 2;
} }
else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ALAW || else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ALAW ||
adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MULAW) && adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MULAW) &&
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM)
{ {
adss->cbDstLength = adss->cbSrcLength / 2; adss->cbDstLength = adss->cbSrcLength * 2;
} }
else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ALAW || else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ALAW ||
adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MULAW) && adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MULAW) &&