From 5afb87aa03bd796c4c4f3e333942877b2b4cd5a3 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?J=C3=B6rg=20H=C3=B6hle?= Date: Sun, 18 Oct 2009 18:31:15 +0200 Subject: [PATCH] mciwave: Set wave format PCM is the only one accepted. --- dlls/mciwave/mciwave.c | 10 +++++----- dlls/winmm/tests/mci.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/mciwave/mciwave.c b/dlls/mciwave/mciwave.c index a6d18a3..69dc89c 100644 --- a/dlls/mciwave/mciwave.c +++ b/dlls/mciwave/mciwave.c @@ -1307,6 +1307,11 @@ static DWORD WAVE_mciSet(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpPa TRACE("MCI_WAVE_SET_ANYINPUT !\n"); if (dwFlags & MCI_WAVE_SET_ANYOUTPUT) TRACE("MCI_WAVE_SET_ANYOUTPUT !\n"); + if (dwFlags & MCI_WAVE_SET_FORMATTAG) { + TRACE("MCI_WAVE_SET_FORMATTAG = %d\n", ((LPMCI_WAVE_SET_PARMS)lpParms)->wFormatTag); + if (((LPMCI_WAVE_SET_PARMS)lpParms)->wFormatTag != WAVE_FORMAT_PCM) + return MCIERR_OUTOFRANGE; + } if (dwFlags & MCI_WAVE_SET_AVGBYTESPERSEC) { wmw->wfxRef.nAvgBytesPerSec = ((LPMCI_WAVE_SET_PARMS)lpParms)->nAvgBytesPerSec; TRACE("MCI_WAVE_SET_AVGBYTESPERSEC = %d\n", wmw->wfxRef.nAvgBytesPerSec); @@ -1323,11 +1328,6 @@ static DWORD WAVE_mciSet(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpPa wmw->wfxRef.nChannels = ((LPMCI_WAVE_SET_PARMS)lpParms)->nChannels; TRACE("MCI_WAVE_SET_CHANNELS = %d\n", wmw->wfxRef.nChannels); } - if (dwFlags & MCI_WAVE_SET_FORMATTAG) { - /* Dangerous because the correct cbSize cannot be set */ - wmw->wfxRef.wFormatTag = ((LPMCI_WAVE_SET_PARMS)lpParms)->wFormatTag; - TRACE("MCI_WAVE_SET_FORMATTAG = %d\n", wmw->wfxRef.wFormatTag); - } if (dwFlags & MCI_WAVE_SET_SAMPLESPERSEC) { wmw->wfxRef.nSamplesPerSec = ((LPMCI_WAVE_SET_PARMS)lpParms)->nSamplesPerSec; TRACE("MCI_WAVE_SET_SAMPLESPERSEC = %d\n", wmw->wfxRef.nSamplesPerSec); diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c index 5d6949a..8346652 100644 --- a/dlls/winmm/tests/mci.c +++ b/dlls/winmm/tests/mci.c @@ -233,7 +233,7 @@ static void test_recordWAVE(HWND hwnd) /* MCI seems to solely support PCM, no need for ACM conversion. */ err = mciSendString("set x format tag 2", NULL, 0, NULL); - todo_wine ok(err==MCIERR_OUTOFRANGE,"mci set format tag 2 returned error: %d\n", err); + ok(err==MCIERR_OUTOFRANGE,"mci set format tag 2 returned error: %d\n", err); err = mciSendString("set x format tag pcm", NULL, 0, NULL); ok(!err,"mci set format tag pcm returned error: %d\n", err); -- 1.5.6.3