Commit ffebb919 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

winemp3.acm: Fix error in acmStreamSize().

parent d31d656b
......@@ -940,11 +940,11 @@ static LRESULT MPEG3_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE ad
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_MPEG))
{
nblocks = adss->cbSrcLength / (adsi->pwfxSrc->nBlockAlign * 1152);
if (nblocks == 0)
return ACMERR_NOTPOSSIBLE;
if (adss->cbSrcLength % (DWORD)(adsi->pwfxSrc->nBlockAlign * 1152))
/* Round block count up. */
nblocks++;
if (nblocks == 0)
return ACMERR_NOTPOSSIBLE;
adss->cbDstLength = 3000 + nblocks * (DWORD)(adsi->pwfxDst->nAvgBytesPerSec * 1152 / adsi->pwfxDst->nSamplesPerSec + 0.5);
}
else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MPEGLAYER3 ||
......@@ -952,11 +952,11 @@ static LRESULT MPEG3_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE ad
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM)
{
nblocks = adss->cbSrcLength / (DWORD)(adsi->pwfxSrc->nAvgBytesPerSec * 1152 / adsi->pwfxSrc->nSamplesPerSec);
if (nblocks == 0)
return ACMERR_NOTPOSSIBLE;
if (adss->cbSrcLength % (DWORD)(adsi->pwfxSrc->nAvgBytesPerSec * 1152 / adsi->pwfxSrc->nSamplesPerSec))
/* Round block count up. */
nblocks++;
if (nblocks == 0)
return ACMERR_NOTPOSSIBLE;
adss->cbDstLength = nblocks * 1152 * adsi->pwfxDst->nBlockAlign;
}
else
......
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