Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
7a04c24e
Commit
7a04c24e
authored
Sep 05, 2007
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Sep 10, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Fix detection of different sample rates in setformat.
parent
7144849d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
primary.c
dlls/dsound/primary.c
+15
-4
No files found.
dlls/dsound/primary.c
View file @
7a04c24e
...
...
@@ -71,6 +71,8 @@ static void DSOUND_RecalcPrimary(DirectSoundDevice *device)
HRESULT
DSOUND_ReopenDevice
(
DirectSoundDevice
*
device
,
BOOL
forcewave
)
{
HRESULT
hres
=
DS_OK
;
TRACE
(
"(%p, %d)
\n
"
,
device
,
forcewave
);
if
(
device
->
driver
)
{
IDsDriver_Close
(
device
->
driver
);
...
...
@@ -336,7 +338,7 @@ HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device)
err
=
IDsDriverBuffer_Stop
(
device
->
hwbuf
);
if
(
err
==
DSERR_BUFFERLOST
)
{
DSOUND_PrimaryClose
(
device
);
err
=
DSOUND_ReopenDevice
(
device
,
!
device
->
driver
);
err
=
DSOUND_ReopenDevice
(
device
,
FALSE
);
if
(
FAILED
(
err
))
ERR
(
"DSOUND_ReopenDevice failed
\n
"
);
else
...
...
@@ -454,6 +456,7 @@ HRESULT DSOUND_PrimarySetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex,
err
=
DS_OK
;
goto
done
;
}
if
(
err
==
S_FALSE
)
{
/* ALSA specific: S_FALSE tells that recreation was successful,
...
...
@@ -476,20 +479,28 @@ HRESULT DSOUND_PrimarySetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex,
{
DSOUND_PrimaryClose
(
device
);
if
(
device
->
drvdesc
.
dwFlags
&
DSDDESC_DOMMSYSTEMSETFORMAT
)
{
err
=
DSOUND_ReopenDevice
(
device
,
FALSE
);
if
(
FAILED
(
err
))
{
WARN
(
"DSOUND_ReopenDevice failed: %08x
\n
"
,
err
);
goto
done
;
}
}
err
=
DSOUND_PrimaryOpen
(
device
);
if
(
err
!=
DS_OK
)
{
WARN
(
"DSOUND_PrimaryOpen failed
\n
"
);
goto
done
;
}
if
(
wfex
->
nSamplesPerSec
/
100
!=
device
->
pwfx
->
nSamplesPerSec
/
100
&&
forced
&&
device
->
buffer
)
{
DSOUND_PrimaryClose
(
device
);
device
->
pwfx
->
nSamplesPerSec
=
wfex
->
nSamplesPerSec
;
err
=
DSOUND_ReopenDevice
(
device
,
TRUE
);
if
(
FAILED
(
err
))
WARN
(
"DSOUND_ReopenDevice(2) failed: %08x
\n
"
,
err
);
else
if
(
FAILED
((
err
=
DSOUND_PrimaryOpen
(
device
))))
WARN
(
"DSOUND_PrimaryOpen(2) failed: %08x
\n
"
,
err
);
}
}
if
(
nSamplesPerSec
!=
device
->
pwfx
->
nSamplesPerSec
||
bpp
!=
device
->
pwfx
->
wBitsPerSample
||
chans
!=
device
->
pwfx
->
nChannels
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment