Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sam Joan Roque-Worcel
wine
Commits
eba8cee5
Commit
eba8cee5
authored
24 years ago
by
Marcus Meissner
Committed by
Alexandre Julliard
24 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Handle errors for IDsDriver_GetPosition.
Report DSERR_UNINITIALIZED on non-opened WineOSS audio device.
parent
247a94f6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/dsound/dsound_main.c
+17
-3
17 additions, 3 deletions
dlls/dsound/dsound_main.c
dlls/winmm/wineoss/audio.c
+4
-0
4 additions, 0 deletions
dlls/winmm/wineoss/audio.c
with
21 additions
and
3 deletions
dlls/dsound/dsound_main.c
+
17
−
3
View file @
eba8cee5
...
...
@@ -1295,10 +1295,14 @@ static DWORD WINAPI IDirectSoundBufferImpl_Release(LPDIRECTSOUNDBUFFER iface) {
static
HRESULT
WINAPI
IDirectSoundBufferImpl_GetCurrentPosition
(
LPDIRECTSOUNDBUFFER
iface
,
LPDWORD
playpos
,
LPDWORD
writepos
)
{
HRESULT
hres
;
ICOM_THIS
(
IDirectSoundBufferImpl
,
iface
);
TRACE
(
"(%p,%p,%p)
\n
"
,
This
,
playpos
,
writepos
);
if
(
This
->
hwbuf
)
{
IDsDriverBuffer_GetPosition
(
This
->
hwbuf
,
playpos
,
writepos
);
hres
=
IDsDriverBuffer_GetPosition
(
This
->
hwbuf
,
playpos
,
writepos
);
if
(
hres
)
return
hres
;
}
else
if
(
This
->
dsbd
.
dwFlags
&
DSBCAPS_PRIMARYBUFFER
)
{
if
(
playpos
&&
(
This
->
dsbd
.
dwFlags
&
DSBCAPS_GETCURRENTPOSITION2
))
{
...
...
@@ -2690,6 +2694,7 @@ static void CALLBACK DSOUND_timer(UINT timerID, UINT msg, DWORD dwUser, DWORD dw
DWORD
len
;
int
nfiller
;
BOOL
forced
;
HRESULT
hres
;
if
(
!
dsound
||
!
primarybuf
)
{
ERR
(
"dsound died without killing us?
\n
"
);
...
...
@@ -2716,7 +2721,11 @@ static void CALLBACK DSOUND_timer(UINT timerID, UINT msg, DWORD dwUser, DWORD dw
if
(
dsound
->
priolevel
!=
DSSCL_WRITEPRIMARY
)
{
BOOL
paused
=
((
primarybuf
->
state
==
STATE_STOPPED
)
||
(
primarybuf
->
state
==
STATE_STARTING
));
DWORD
playpos
,
writepos
,
inq
,
maxq
,
mixq
,
frag
;
IDsDriverBuffer_GetPosition
(
primarybuf
->
hwbuf
,
&
playpos
,
&
writepos
);
hres
=
IDsDriverBuffer_GetPosition
(
primarybuf
->
hwbuf
,
&
playpos
,
&
writepos
);
if
(
hres
)
{
LeaveCriticalSection
(
&
(
dsound
->
lock
));
return
;
}
/* Well, we *could* do Just-In-Time mixing using the writepos,
* but that's a little bit ambitious and unnecessary... */
/* rather add our safety margin to the writepos, if we're playing */
...
...
@@ -2776,7 +2785,12 @@ static void CALLBACK DSOUND_timer(UINT timerID, UINT msg, DWORD dwUser, DWORD dw
}
/* the Stop is supposed to reset play position to beginning of buffer */
/* unfortunately, OSS is not able to do so, so get current pointer */
IDsDriverBuffer_GetPosition
(
primarybuf
->
hwbuf
,
&
playpos
,
NULL
);
hres
=
IDsDriverBuffer_GetPosition
(
primarybuf
->
hwbuf
,
&
playpos
,
NULL
);
if
(
hres
)
{
LeaveCriticalSection
(
&
(
dsound
->
lock
));
LeaveCriticalSection
(
&
(
primarybuf
->
lock
));
return
;
}
writepos
=
playpos
;
primarybuf
->
playpos
=
playpos
;
primarybuf
->
mixpos
=
playpos
;
...
...
This diff is collapsed.
Click to expand it.
dlls/winmm/wineoss/audio.c
+
4
−
0
View file @
eba8cee5
...
...
@@ -1412,6 +1412,10 @@ static HRESULT WINAPI IDsDriverBufferImpl_GetPosition(PIDSDRIVERBUFFER iface,
DWORD
ptr
;
TRACE
(
"(%p)
\n
"
,
iface
);
if
(
WOutDev
[
This
->
drv
->
wDevID
].
unixdev
==
-
1
)
{
ERR
(
"device not open, but accessing?
\n
"
);
return
DSERR_UNINITIALIZED
;
}
if
(
ioctl
(
WOutDev
[
This
->
drv
->
wDevID
].
unixdev
,
SNDCTL_DSP_GETOPTR
,
&
info
)
<
0
)
{
ERR
(
"ioctl failed (%d)
\n
"
,
errno
);
return
DSERR_GENERIC
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment