[PATCH v3 4/4] msacm32: Try to suggest PCM to PCM conversion first.
Andrew Eikum
aeikum at codeweavers.com
Thu Jun 8 07:43:34 CDT 2017
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
On Wed, Jun 07, 2017 at 04:07:53PM -0500, Zebediah Figura wrote:
> Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
> ---
> dlls/msacm32/format.c | 16 ++++++++++++++++
> dlls/msacm32/tests/msacm.c | 2 --
> 2 files changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/dlls/msacm32/format.c b/dlls/msacm32/format.c
> index d7a2cc9229..f3c515587a 100644
> --- a/dlls/msacm32/format.c
> +++ b/dlls/msacm32/format.c
> @@ -733,6 +733,22 @@ MMRESULT WINAPI acmFormatSuggest(HACMDRIVER had, PWAVEFORMATEX pwfxSrc,
> ACM_FORMATSUGGESTF_WBITSPERSAMPLE|ACM_FORMATSUGGESTF_WFORMATTAG))
> return MMSYSERR_INVALFLAG;
>
> + /* if we were given PCM, try to convert to PCM */
> + if (pwfxSrc->wFormatTag == WAVE_FORMAT_PCM && !had &&
> + !(fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG))
> + {
> + ACMFORMATDETAILSW afd = {0};
> + afd.cbStruct = sizeof(afd);
> + afd.dwFormatTag = WAVE_FORMAT_PCM;
> + afd.pwfx = pwfxSrc;
> + afd.cbwfx = sizeof(PCMWAVEFORMAT);
> + if (!acmFormatDetailsW(had, &afd, ACM_FORMATDETAILSF_FORMAT))
> + {
> + memcpy(pwfxDst, pwfxSrc, sizeof(PCMWAVEFORMAT));
> + return MMSYSERR_NOERROR;
> + }
> + }
> +
> aftd.cbStruct = sizeof(aftd);
> if (fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG)
> aftd.dwFormatTag = pwfxDst->wFormatTag;
> diff --git a/dlls/msacm32/tests/msacm.c b/dlls/msacm32/tests/msacm.c
> index f2381ce9ac..b214b38b6a 100644
> --- a/dlls/msacm32/tests/msacm.c
> +++ b/dlls/msacm32/tests/msacm.c
> @@ -1063,7 +1063,6 @@ static void test_acmFormatSuggest(void)
> suggest = 0;
> memset(&dst, 0, sizeof(dst));
> rc = acmFormatSuggest(NULL, &src, &dst, sizeof(PCMWAVEFORMAT), suggest);
> - todo_wine {
> ok(rc == MMSYSERR_NOERROR, "failed with error 0x%x\n", rc);
> ok(src.wFormatTag == dst.wFormatTag, "expected %d, got %d\n", src.wFormatTag, dst.wFormatTag);
> ok(src.nChannels == dst.nChannels, "expected %d, got %d\n", src.nChannels, dst.nChannels);
> @@ -1071,7 +1070,6 @@ static void test_acmFormatSuggest(void)
> ok(src.nAvgBytesPerSec == dst.nAvgBytesPerSec, "expected %d, got %d\n", src.nAvgBytesPerSec, dst.nAvgBytesPerSec);
> ok(src.nBlockAlign == dst.nBlockAlign, "expected %d, got %d\n", src.nBlockAlign, dst.nBlockAlign);
> ok(src.wBitsPerSample == dst.wBitsPerSample, "expected %d, got %d\n", src.wBitsPerSample, dst.wBitsPerSample);
> - }
>
> /* All parameters from destination are valid */
> suggest = ACM_FORMATSUGGESTF_NCHANNELS
> --
> 2.13.0
>
>
>
More information about the wine-patches
mailing list