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
7ecf3d03
Commit
7ecf3d03
authored
Feb 06, 2004
by
Robert Reif
Committed by
Alexandre Julliard
Feb 06, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fallback to software buffer if duplicating hardware buffer fails.
parent
2ea305b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
8 deletions
+36
-8
dsound_main.c
dlls/dsound/dsound_main.c
+36
-8
No files found.
dlls/dsound/dsound_main.c
View file @
7ecf3d03
...
...
@@ -593,12 +593,6 @@ static HRESULT WINAPI IDirectSoundImpl_DuplicateSoundBuffer(
pdsb
=
((
SecondaryBufferImpl
*
)
psb
)
->
dsb
;
if
(
pdsb
->
hwbuf
)
{
FIXME
(
"need to duplicate hardware buffer
\n
"
);
*
ppdsb
=
NULL
;
return
DSERR_INVALIDCALL
;
}
dsb
=
(
IDirectSoundBufferImpl
*
)
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
dsb
));
if
(
dsb
==
NULL
)
{
...
...
@@ -608,13 +602,47 @@ static HRESULT WINAPI IDirectSoundImpl_DuplicateSoundBuffer(
}
memcpy
(
dsb
,
pdsb
,
sizeof
(
IDirectSoundBufferImpl
));
if
(
pdsb
->
hwbuf
)
{
TRACE
(
"duplicating hardware buffer
\n
"
);
hres
=
IDsDriver_DuplicateSoundBuffer
(
This
->
driver
,
pdsb
->
hwbuf
,
(
LPVOID
*
)
&
dsb
->
hwbuf
);
if
(
hres
!=
DS_OK
)
{
TRACE
(
"IDsDriver_DuplicateSoundBuffer failed, falling back to software buffer
\n
"
);
dsb
->
hwbuf
=
NULL
;
/* allocate buffer */
if
(
This
->
drvdesc
.
dwFlags
&
DSDDESC_USESYSTEMMEMORY
)
{
dsb
->
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
(
dsb
->
buffer
)));
if
(
dsb
->
buffer
==
NULL
)
{
WARN
(
"out of memory
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
dsb
);
*
ppdsb
=
NULL
;
return
DSERR_OUTOFMEMORY
;
}
dsb
->
buffer
->
memory
=
(
LPBYTE
)
HeapAlloc
(
GetProcessHeap
(),
0
,
dsb
->
buflen
);
if
(
dsb
->
buffer
->
memory
==
NULL
)
{
WARN
(
"out of memory
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
dsb
->
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
dsb
);
*
ppdsb
=
NULL
;
return
DSERR_OUTOFMEMORY
;
}
dsb
->
buffer
->
ref
=
1
;
/* FIXME: copy buffer ? */
}
}
}
else
{
dsb
->
hwbuf
=
NULL
;
dsb
->
buffer
->
ref
++
;
}
dsb
->
ref
=
0
;
dsb
->
state
=
STATE_STOPPED
;
dsb
->
playpos
=
0
;
dsb
->
buf_mixpos
=
0
;
dsb
->
dsound
=
This
;
dsb
->
buffer
->
ref
++
;
dsb
->
hwbuf
=
NULL
;
dsb
->
ds3db
=
NULL
;
dsb
->
iks
=
NULL
;
/* FIXME? */
dsb
->
dsb
=
NULL
;
...
...
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