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
a6d37f6d
Commit
a6d37f6d
authored
Sep 22, 2003
by
Oleg Prokhorov
Committed by
Alexandre Julliard
Sep 22, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented sound flushing.
parent
83fca4ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
audio.c
dlls/winmm/winealsa/audio.c
+42
-0
No files found.
dlls/winmm/winealsa/audio.c
View file @
a6d37f6d
...
...
@@ -134,6 +134,9 @@ typedef struct {
snd_pcm_sframes_t
(
*
write
)(
snd_pcm_t
*
,
const
void
*
,
snd_pcm_uframes_t
);
struct
pollfd
*
ufds
;
int
count
;
DWORD
dwBufferSize
;
/* size of whole ALSA buffer in bytes */
LPWAVEHDR
lpQueuePtr
;
/* start of queued WAVEHDRs (waiting to be notified) */
LPWAVEHDR
lpPlayPtr
;
/* start of not yet fully played buffers */
...
...
@@ -835,6 +838,24 @@ static DWORD wodPlayer_NotifyCompletions(WINE_WAVEOUT* wwo, BOOL force)
wodPlayer_NotifyWait
(
wwo
,
lpWaveHdr
)
:
INFINITE
;
}
void
wait_for_poll
(
snd_pcm_t
*
handle
,
struct
pollfd
*
ufds
,
unsigned
int
count
)
{
unsigned
short
revents
;
while
(
1
)
{
poll
(
ufds
,
count
,
-
1
);
snd_pcm_poll_descriptors_revents
(
handle
,
ufds
,
count
,
&
revents
);
if
(
revents
&
POLLERR
)
return
;
/*if (revents & POLLOUT)
return 0;*/
}
}
/**************************************************************************
* wodPlayer_Reset [internal]
*
...
...
@@ -847,6 +868,9 @@ static void wodPlayer_Reset(WINE_WAVEOUT* wwo)
HANDLE
ev
;
int
err
;
/* flush all possible output */
wait_for_poll
(
wwo
->
p_handle
,
wwo
->
ufds
,
wwo
->
count
);
/* updates current notify list */
wodPlayer_NotifyCompletions
(
wwo
,
FALSE
);
...
...
@@ -1186,6 +1210,22 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
ALSA_InitRingMessage
(
&
wwo
->
msgRing
);
wwo
->
count
=
snd_pcm_poll_descriptors_count
(
wwo
->
p_handle
);
if
(
wwo
->
count
<=
0
)
{
ERR
(
"Invalid poll descriptors count
\n
"
);
return
MMSYSERR_ERROR
;
}
wwo
->
ufds
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
struct
pollfd
)
*
wwo
->
count
);
if
(
wwo
->
ufds
==
NULL
)
{
ERR
(
"No enough memory
\n
"
);
return
MMSYSERR_NOMEM
;
}
if
((
err
=
snd_pcm_poll_descriptors
(
wwo
->
p_handle
,
wwo
->
ufds
,
wwo
->
count
))
<
0
)
{
ERR
(
"Unable to obtain poll descriptors for playback: %s
\n
"
,
snd_strerror
(
err
));
return
MMSYSERR_ERROR
;
}
if
(
!
(
dwFlags
&
WAVE_DIRECTSOUND
))
{
wwo
->
hStartUpEvent
=
CreateEventA
(
NULL
,
FALSE
,
FALSE
,
NULL
);
wwo
->
hThread
=
CreateThread
(
NULL
,
0
,
wodPlayer
,
(
LPVOID
)(
DWORD
)
wDevID
,
0
,
&
(
wwo
->
dwThreadID
));
...
...
@@ -1243,6 +1283,8 @@ static DWORD wodClose(WORD wDevID)
ret
=
wodNotifyClient
(
wwo
,
WOM_CLOSE
,
0L
,
0L
);
}
HeapFree
(
GetProcessHeap
(),
0
,
wwo
->
ufds
);
return
ret
;
}
...
...
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