Commit ad75d9a2 authored by Jörg Höhle's avatar Jörg Höhle Committed by Alexandre Julliard

winmm/tests: Correct (IMA)ADPCM test.

parent 4781e055
...@@ -825,6 +825,7 @@ static void wave_out_test_device(UINT_PTR device) ...@@ -825,6 +825,7 @@ static void wave_out_test_device(UINT_PTR device)
WAVEOUTCAPSW capsW; WAVEOUTCAPSW capsW;
WAVEFORMATEX format, oformat; WAVEFORMATEX format, oformat;
WAVEFORMATEXTENSIBLE wfex; WAVEFORMATEXTENSIBLE wfex;
IMAADPCMWAVEFORMAT wfa;
HWAVEOUT wout; HWAVEOUT wout;
MMRESULT rc; MMRESULT rc;
UINT f; UINT f;
...@@ -1159,7 +1160,6 @@ static void wave_out_test_device(UINT_PTR device) ...@@ -1159,7 +1160,6 @@ static void wave_out_test_device(UINT_PTR device)
format.nBlockAlign=format.nChannels*format.wBitsPerSample/8; format.nBlockAlign=format.nChannels*format.wBitsPerSample/8;
format.nAvgBytesPerSec=format.nSamplesPerSec*format.nBlockAlign; format.nAvgBytesPerSec=format.nSamplesPerSec*format.nBlockAlign;
format.cbSize=0; format.cbSize=0;
oformat=format;
rc=waveOutOpen(&wout,device,&format,0,0,CALLBACK_NULL|WAVE_FORMAT_DIRECT); rc=waveOutOpen(&wout,device,&format,0,0,CALLBACK_NULL|WAVE_FORMAT_DIRECT);
ok(rc==MMSYSERR_NOERROR ||rc==WAVERR_BADFORMAT || ok(rc==MMSYSERR_NOERROR ||rc==WAVERR_BADFORMAT ||
rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM, rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM,
...@@ -1176,28 +1176,30 @@ static void wave_out_test_device(UINT_PTR device) ...@@ -1176,28 +1176,30 @@ static void wave_out_test_device(UINT_PTR device)
trace("waveOutOpen(%s): WAVE_FORMAT_MULAW not supported\n", trace("waveOutOpen(%s): WAVE_FORMAT_MULAW not supported\n",
dev_name(device)); dev_name(device));
format.wFormatTag=WAVE_FORMAT_ADPCM; wfa.wfx.wFormatTag=WAVE_FORMAT_IMA_ADPCM;
format.nChannels=2; wfa.wfx.nChannels=1;
format.wBitsPerSample=4; wfa.wfx.nSamplesPerSec=11025;
format.nSamplesPerSec=22050; wfa.wfx.nAvgBytesPerSec=5588;
format.nBlockAlign=format.nChannels*format.wBitsPerSample/8; wfa.wfx.nBlockAlign=256;
format.nAvgBytesPerSec=format.nSamplesPerSec*format.nBlockAlign; wfa.wfx.wBitsPerSample=4; /* see imaadp32.c */
format.cbSize=0; wfa.wfx.cbSize=2;
oformat=format; wfa.wSamplesPerBlock=505;
rc=waveOutOpen(&wout,device,&format,0,0,CALLBACK_NULL|WAVE_FORMAT_DIRECT); rc=waveOutOpen(&wout,device,&wfa.wfx,0,0,CALLBACK_NULL|WAVE_FORMAT_DIRECT);
ok(rc==MMSYSERR_NOERROR ||rc==WAVERR_BADFORMAT || ok(rc==MMSYSERR_NOERROR ||rc==WAVERR_BADFORMAT ||
rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM, rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM,
"waveOutOpen(%s): returned %s\n",dev_name(device),wave_out_error(rc)); "waveOutOpen(%s): returned %s\n",dev_name(device),wave_out_error(rc));
if (rc==MMSYSERR_NOERROR) { if (rc==MMSYSERR_NOERROR) {
waveOutClose(wout); waveOutClose(wout);
wave_out_test_deviceOut(device,1.0,1,0,&format,0,CALLBACK_EVENT, /* TODO: teach wave_generate_* ADPCM
wave_out_test_deviceOut(device,1.0,1,0,&wfa.wfx,0,CALLBACK_EVENT,
&capsA,winetest_interactive,TRUE,FALSE); &capsA,winetest_interactive,TRUE,FALSE);
wave_out_test_deviceOut(device,1.0,10,0,&format,0,CALLBACK_EVENT, wave_out_test_deviceOut(device,1.0,10,0,&wfa.wfx,0,CALLBACK_EVENT,
&capsA,winetest_interactive,TRUE,FALSE); &capsA,winetest_interactive,TRUE,FALSE);
wave_out_test_deviceOut(device,1.0,5,1,&format,0,CALLBACK_EVENT, wave_out_test_deviceOut(device,1.0,5,1,&wfa.wfx,0,CALLBACK_EVENT,
&capsA,winetest_interactive,TRUE,FALSE); &capsA,winetest_interactive,TRUE,FALSE);
*/
} else } else
trace("waveOutOpen(%s): WAVE_FORMAT_ADPCM not supported\n", trace("waveOutOpen(%s): WAVE_FORMAT_IMA_ADPCM not supported\n",
dev_name(device)); dev_name(device));
/* test if WAVEFORMATEXTENSIBLE supported */ /* test if WAVEFORMATEXTENSIBLE supported */
......
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