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
a1e57324
Commit
a1e57324
authored
Apr 01, 2002
by
Eric Pouech
Committed by
Alexandre Julliard
Apr 01, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More robust and less time consuming playback.
parent
3209f949
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
16 deletions
+25
-16
audio.c
dlls/winmm/wineoss/audio.c
+25
-16
No files found.
dlls/winmm/wineoss/audio.c
View file @
a1e57324
...
...
@@ -716,23 +716,30 @@ static DWORD wodPlayer_NotifyWait(const WINE_WAVEOUT* wwo, LPWAVEHDR lpWaveHdr)
/**************************************************************************
* wodPlayer_WriteMaxFrags [internal]
* Writes the maximum number of bytes possible to the DSP and returns
*
the number of bytes written.
*
TRUE iff the current playPtr has been fully played
*/
static
int
wodPlayer_WriteMaxFrags
(
WINE_WAVEOUT
*
wwo
,
DWORD
*
bytes
)
static
BOOL
wodPlayer_WriteMaxFrags
(
WINE_WAVEOUT
*
wwo
,
DWORD
*
bytes
)
{
/* Only attempt to write to free bytes */
DWORD
dwLength
=
wwo
->
lpPlayPtr
->
dwBufferLength
-
wwo
->
dwPartialOffset
;
int
toWrite
=
min
(
dwLength
,
*
bytes
)
;
int
written
;
DWORD
dwLength
=
wwo
->
lpPlayPtr
->
dwBufferLength
-
wwo
->
dwPartialOffset
;
DWORD
toWrite
=
min
(
dwLength
,
*
bytes
)
;
int
written
;
BOOL
ret
=
FALSE
;
TRACE
(
"Writing wavehdr %p.%lu[%lu]
\n
"
,
wwo
->
lpPlayPtr
,
wwo
->
dwPartialOffset
,
wwo
->
lpPlayPtr
->
dwBufferLength
);
written
=
write
(
wwo
->
unixdev
,
wwo
->
lpPlayPtr
->
lpData
+
wwo
->
dwPartialOffset
,
toWrite
);
if
(
written
<=
0
)
return
written
;
TRACE
(
"Writing wavehdr %p.%lu[%lu]/%lu
\n
"
,
wwo
->
lpPlayPtr
,
wwo
->
dwPartialOffset
,
wwo
->
lpPlayPtr
->
dwBufferLength
,
toWrite
);
if
(
toWrite
>
0
)
{
written
=
write
(
wwo
->
unixdev
,
wwo
->
lpPlayPtr
->
lpData
+
wwo
->
dwPartialOffset
,
toWrite
);
if
(
written
<=
0
)
return
FALSE
;
}
else
written
=
0
;
if
(
written
>=
dwLength
)
{
/* If we wrote all current wavehdr, skip to the next one */
wodPlayer_PlayPtrNext
(
wwo
);
ret
=
TRUE
;
}
else
{
/* Remove the amount written */
wwo
->
dwPartialOffset
+=
written
;
...
...
@@ -740,7 +747,7 @@ static int wodPlayer_WriteMaxFrags(WINE_WAVEOUT* wwo, DWORD* bytes)
*
bytes
-=
written
;
wwo
->
dwWrittenTotal
+=
written
;
return
written
;
return
ret
;
}
...
...
@@ -937,7 +944,8 @@ static DWORD wodPlayer_FeedDSP(WINE_WAVEOUT* wwo)
/* input queue empty and output buffer with less than one fragment to play */
if
(
!
wwo
->
lpPlayPtr
&&
wwo
->
dwBufferSize
<
availInQ
+
2
*
wwo
->
dwFragmentSize
)
{
TRACE
(
"Run out of wavehdr:s... flushing
\n
"
);
TRACE
(
"Run out of wavehdr:s... flushing (%lu => %lu)
\n
"
,
wwo
->
dwPlayedTotal
,
wwo
->
dwWrittenTotal
);
ioctl
(
wwo
->
unixdev
,
SNDCTL_DSP_SYNC
,
0
);
wwo
->
dwPlayedTotal
=
wwo
->
dwWrittenTotal
;
return
INFINITE
;
...
...
@@ -951,12 +959,13 @@ static DWORD wodPlayer_FeedDSP(WINE_WAVEOUT* wwo)
}
/* Feed wavehdrs until we run out of wavehdrs or DSP space */
if
(
wwo
->
dwPartialOffset
==
0
)
{
while
(
wwo
->
lpPlayPtr
&&
availInQ
>
0
)
{
if
(
wwo
->
dwPartialOffset
==
0
&&
wwo
->
lpPlayPtr
)
{
do
{
TRACE
(
"Setting time to elapse for %p to %lu
\n
"
,
wwo
->
lpPlayPtr
,
wwo
->
dwWrittenTotal
+
wwo
->
lpPlayPtr
->
dwBufferLength
);
/* note the value that dwPlayedTotal will return when this wave finishes playing */
wwo
->
lpPlayPtr
->
reserved
=
wwo
->
dwWrittenTotal
+
wwo
->
lpPlayPtr
->
dwBufferLength
;
wodPlayer_WriteMaxFrags
(
wwo
,
&
availInQ
);
}
}
while
(
wodPlayer_WriteMaxFrags
(
wwo
,
&
availInQ
)
&&
wwo
->
lpPlayPtr
&&
availInQ
>
0
);
}
}
...
...
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