Commit b50347d4 authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

Don't consider a bad format an error unless the capabilities say it

should be supported. Don't consider a device already in use an error.
parent eb883577
...@@ -435,7 +435,7 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, ...@@ -435,7 +435,7 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
if (winetest_interactive) if (winetest_interactive)
trace(" Testing the capture buffer at %s\n", format_string(&wfx)); trace(" Testing the capture buffer at %s\n", format_string(&wfx));
rc=IDirectSoundCapture_CreateCaptureBuffer(dsco,&bufdesc,&dscbo,NULL); rc=IDirectSoundCapture_CreateCaptureBuffer(dsco,&bufdesc,&dscbo,NULL);
ok((rc==DS_OK)&&(dscbo!=NULL), ok(((rc==DS_OK)&&(dscbo!=NULL))||(rc==DSERR_BADFORMAT)||(rc==DSERR_ALLOCATED),
"IDirectSoundCapture_CreateCaptureBuffer() failed to create a " "IDirectSoundCapture_CreateCaptureBuffer() failed to create a "
"capture buffer: %s\n",DXGetErrorString8(rc)); "capture buffer: %s\n",DXGetErrorString8(rc));
if (rc==DS_OK) { if (rc==DS_OK) {
...@@ -443,7 +443,14 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, ...@@ -443,7 +443,14 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
ref=IDirectSoundCaptureBuffer_Release(dscbo); ref=IDirectSoundCaptureBuffer_Release(dscbo);
ok(ref==0,"IDirectSoundCaptureBuffer_Release() has %d references, " ok(ref==0,"IDirectSoundCaptureBuffer_Release() has %d references, "
"should have 0\n",ref); "should have 0\n",ref);
} } else if (rc==DSERR_BADFORMAT) {
ok(!(dsccaps.dwFormats & formats[f][3]),
"IDirectSoundCapture_CreateCaptureBuffer() failed to create a "
"capture buffer: format listed as supported but using it failed\n");
if (!(dsccaps.dwFormats & formats[f][3]))
trace(" Format not supported: %s\n", format_string(&wfx));
} else if (rc==DSERR_ALLOCATED)
trace(" Already In Use\n");
} }
/* try a non PCM format */ /* try a non PCM format */
......
...@@ -18,31 +18,31 @@ ...@@ -18,31 +18,31 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
static const unsigned int formats[][3]={ static const unsigned int formats[][4]={
{ 8000, 8, 1}, { 8000, 8, 1, 0 },
{ 8000, 8, 2}, { 8000, 8, 2, 0 },
{ 8000, 16, 1}, { 8000, 16, 1, 0 },
{ 8000, 16, 2}, { 8000, 16, 2, 0 },
{11025, 8, 1}, {11025, 8, 1, WAVE_FORMAT_1M08 },
{11025, 8, 2}, {11025, 8, 2, WAVE_FORMAT_1S08 },
{11025, 16, 1}, {11025, 16, 1, WAVE_FORMAT_1M16 },
{11025, 16, 2}, {11025, 16, 2, WAVE_FORMAT_1S16 },
{22050, 8, 1}, {22050, 8, 1, WAVE_FORMAT_2M08 },
{22050, 8, 2}, {22050, 8, 2, WAVE_FORMAT_2S08 },
{22050, 16, 1}, {22050, 16, 1, WAVE_FORMAT_2M16 },
{22050, 16, 2}, {22050, 16, 2, WAVE_FORMAT_2S16 },
{44100, 8, 1}, {44100, 8, 1, WAVE_FORMAT_4M08 },
{44100, 8, 2}, {44100, 8, 2, WAVE_FORMAT_4S08 },
{44100, 16, 1}, {44100, 16, 1, WAVE_FORMAT_4M16 },
{44100, 16, 2}, {44100, 16, 2, WAVE_FORMAT_4S16 },
{48000, 8, 1}, {48000, 8, 1, WAVE_FORMAT_48M08 },
{48000, 8, 2}, {48000, 8, 2, WAVE_FORMAT_48S08 },
{48000, 16, 1}, {48000, 16, 1, WAVE_FORMAT_48M16 },
{48000, 16, 2}, {48000, 16, 2, WAVE_FORMAT_48S16 },
{96000, 8, 1}, {96000, 8, 1, WAVE_FORMAT_96M08 },
{96000, 8, 2}, {96000, 8, 2, WAVE_FORMAT_96S08 },
{96000, 16, 1}, {96000, 16, 1, WAVE_FORMAT_96M16 },
{96000, 16, 2} {96000, 16, 2, WAVE_FORMAT_96S16 }
}; };
#define NB_FORMATS (sizeof(formats)/sizeof(*formats)) #define NB_FORMATS (sizeof(formats)/sizeof(*formats))
......
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