Jörg Höhle : mciwave: Set wave format PCM is the only one accepted.

Alexandre Julliard julliard at winehq.org
Thu Nov 5 10:50:03 CST 2009


Module: wine
Branch: master
Commit: 518f4f8cdb035aa7a0820448deabe533f19bae35
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=518f4f8cdb035aa7a0820448deabe533f19bae35

Author: Jörg Höhle <hoehle at users.sourceforge.net>
Date:   Sun Oct 18 18:31:15 2009 +0200

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 0c17f32..fc1c2b2 100644
--- a/dlls/mciwave/mciwave.c
+++ b/dlls/mciwave/mciwave.c
@@ -1310,6 +1310,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);
@@ -1326,11 +1331,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 59cf4ae..e84f108 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);




More information about the wine-cvs mailing list