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
c76d5561
Commit
c76d5561
authored
Apr 01, 2007
by
Chris Robinson
Committed by
Alexandre Julliard
Apr 03, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Use a second-long DSound buffer for playback.
parent
996ced19
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
dsoundrender.c
dlls/quartz/dsoundrender.c
+7
-6
No files found.
dlls/quartz/dsoundrender.c
View file @
c76d5561
...
...
@@ -64,6 +64,7 @@ typedef struct DSoundRenderImpl
LPDIRECTSOUND
dsound
;
LPDIRECTSOUNDBUFFER
dsbuffer
;
DWORD
buf_size
;
DWORD
write_pos
;
BOOL
init
;
...
...
@@ -100,8 +101,6 @@ static HRESULT DSoundRender_InputPin_Construct(const PIN_INFO * pPinInfo, SAMPLE
}
#define DSBUFFERSIZE 8192
static
HRESULT
DSoundRender_CreateSoundBuffer
(
IBaseFilter
*
iface
)
{
HRESULT
hr
;
...
...
@@ -148,13 +147,15 @@ static HRESULT DSoundRender_CreateSoundBuffer(IBaseFilter * iface)
goto
getout
;
}
This
->
buf_size
=
format
->
nAvgBytesPerSec
;
wav_fmt
=
*
format
;
wav_fmt
.
cbSize
=
0
;
memset
(
&
buf_desc
,
0
,
sizeof
(
DSBUFFERDESC
));
buf_desc
.
dwSize
=
sizeof
(
DSBUFFERDESC
);
buf_desc
.
dwFlags
=
DSBCAPS_CTRLVOLUME
|
DSBCAPS_CTRLPAN
|
DSBCAPS_CTRLFREQUENCY
;
buf_desc
.
dwBufferBytes
=
DSBUFFERSIZE
;
buf_desc
.
dwBufferBytes
=
This
->
buf_size
;
buf_desc
.
lpwfxFormat
=
&
wav_fmt
;
hr
=
IDirectSound_CreateSoundBuffer
(
This
->
dsound
,
&
buf_desc
,
&
This
->
dsbuffer
,
NULL
);
if
(
FAILED
(
hr
))
{
...
...
@@ -206,10 +207,10 @@ static HRESULT DSoundRender_SendSampleData(DSoundRenderImpl* This, LPBYTE data,
if
(
This
->
write_pos
<=
play_pos
)
buf_free
=
play_pos
-
This
->
write_pos
;
else
buf_free
=
DSBUFFERSIZE
-
This
->
write_pos
+
play_pos
;
buf_free
=
This
->
buf_size
-
This
->
write_pos
+
play_pos
;
/* Wait for enough of the buffer to empty before filling it */
if
(
buf_free
<
DSBUFFERSIZE
/
4
)
if
(
buf_free
<
This
->
buf_size
/
4
)
{
Sleep
(
10
);
continue
;
...
...
@@ -233,7 +234,7 @@ static HRESULT DSoundRender_SendSampleData(DSoundRenderImpl* This, LPBYTE data,
size
-=
dwsize1
+
dwsize2
;
data
+=
dwsize1
+
dwsize2
;
This
->
write_pos
=
(
This
->
write_pos
+
dwsize1
+
dwsize2
)
%
DSBUFFERSIZE
;
This
->
write_pos
=
(
This
->
write_pos
+
dwsize1
+
dwsize2
)
%
This
->
buf_size
;
}
while
(
size
&&
This
->
state
==
State_Running
);
return
hr
;
...
...
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