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
eba8cee5
Commit
eba8cee5
authored
Dec 21, 2000
by
Marcus Meissner
Committed by
Alexandre Julliard
Dec 21, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle errors for IDsDriver_GetPosition.
Report DSERR_UNINITIALIZED on non-opened WineOSS audio device.
parent
247a94f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
dsound_main.c
dlls/dsound/dsound_main.c
+17
-3
audio.c
dlls/winmm/wineoss/audio.c
+4
-0
No files found.
dlls/dsound/dsound_main.c
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
;
...
...
dlls/winmm/wineoss/audio.c
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
;
...
...
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