Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
717df5b2
Commit
717df5b2
authored
Oct 04, 2008
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Oct 06, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winealsa.drv: Don't hang on last few bytes not played.
Fixes winmm:wave test hanging.
parent
a4a9d50d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
waveout.c
dlls/winealsa.drv/waveout.c
+8
-2
No files found.
dlls/winealsa.drv/waveout.c
View file @
717df5b2
...
...
@@ -104,11 +104,13 @@ static BOOL wodUpdatePlayedTotal(WINE_WAVEDEV* wwo, snd_pcm_status_t* ps)
snd_pcm_delay
(
wwo
->
pcm
,
&
delay
);
/* A delay < 0 indicates an underrun; for our purposes that's 0. */
if
(
(
state
!=
SND_PCM_STATE_RUNNING
&&
state
!=
SND_PCM_STATE_PREPARED
)
||
(
delay
<
0
)
)
if
(
delay
<
0
)
{
WARN
(
"Unexpected state (%d) or delay (%ld) while updating Total Played, resetting
\n
"
,
state
,
delay
);
delay
=
0
;
}
if
(
state
==
SND_PCM_STATE_XRUN
)
snd_pcm_start
(
wwo
->
pcm
);
InterlockedExchange
((
LONG
*
)
&
wwo
->
dwPlayedTotal
,
wwo
->
dwWrittenTotal
-
snd_pcm_frames_to_bytes
(
wwo
->
pcm
,
delay
));
return
TRUE
;
}
...
...
@@ -281,10 +283,14 @@ static DWORD wodPlayer_NotifyCompletions(WINE_WAVEDEV* wwo, BOOL force)
if
(
!
lpWaveHdr
)
{
TRACE
(
"Empty queue
\n
"
);
break
;}
if
(
!
force
)
{
snd_pcm_uframes_t
frames
;
snd_pcm_hw_params_get_period_size
(
wwo
->
hw_params
,
&
frames
,
NULL
);
if
(
lpWaveHdr
==
wwo
->
lpPlayPtr
)
{
TRACE
(
"play %p
\n
"
,
lpWaveHdr
);
break
;}
if
(
lpWaveHdr
==
wwo
->
lpLoopPtr
)
{
TRACE
(
"loop %p
\n
"
,
lpWaveHdr
);
break
;}
if
(
lpWaveHdr
->
reserved
>
wwo
->
dwPlayedTotal
)
{
TRACE
(
"still playing %p (%u/%u)
\n
"
,
lpWaveHdr
,
lpWaveHdr
->
reserved
,
wwo
->
dwPlayedTotal
);
break
;}
if
(
lpWaveHdr
->
reserved
>
wwo
->
dwPlayedTotal
+
frames
)
{
TRACE
(
"still playing %p (%u/%u)
\n
"
,
lpWaveHdr
,
lpWaveHdr
->
reserved
,
wwo
->
dwPlayedTotal
);
break
;}
}
wwo
->
dwPlayedTotal
+=
lpWaveHdr
->
reserved
-
wwo
->
dwPlayedTotal
;
wwo
->
lpQueuePtr
=
lpWaveHdr
->
lpNext
;
lpWaveHdr
->
dwFlags
&=
~
WHDR_INQUEUE
;
...
...
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