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
3bafbb22
Commit
3bafbb22
authored
Sep 29, 2007
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Oct 01, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Use smaller buffers for wavein capture.
parent
290869b0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
24 deletions
+32
-24
capture.c
dlls/dsound/capture.c
+0
-0
dsound_private.h
dlls/dsound/dsound_private.h
+1
-1
primary.c
dlls/dsound/primary.c
+31
-23
No files found.
dlls/dsound/capture.c
View file @
3bafbb22
This diff is collapsed.
Click to expand it.
dlls/dsound/dsound_private.h
View file @
3bafbb22
...
@@ -253,7 +253,6 @@ struct DirectSoundCaptureDevice
...
@@ -253,7 +253,6 @@ struct DirectSoundCaptureDevice
/* more stuff */
/* more stuff */
LPBYTE
buffer
;
LPBYTE
buffer
;
DWORD
buflen
;
DWORD
buflen
;
DWORD
read_position
;
PWAVEFORMATEX
pwfx
;
PWAVEFORMATEX
pwfx
;
...
@@ -420,6 +419,7 @@ HRESULT DSOUND_Create8(REFIID riid, LPDIRECTSOUND8 *ppDS);
...
@@ -420,6 +419,7 @@ HRESULT DSOUND_Create8(REFIID riid, LPDIRECTSOUND8 *ppDS);
/* primary.c */
/* primary.c */
DWORD
DSOUND_fraglen
(
DWORD
nSamplesPerSec
,
DWORD
nBlockAlign
);
HRESULT
DSOUND_PrimaryCreate
(
DirectSoundDevice
*
device
);
HRESULT
DSOUND_PrimaryCreate
(
DirectSoundDevice
*
device
);
HRESULT
DSOUND_PrimaryDestroy
(
DirectSoundDevice
*
device
);
HRESULT
DSOUND_PrimaryDestroy
(
DirectSoundDevice
*
device
);
HRESULT
DSOUND_PrimaryPlay
(
DirectSoundDevice
*
device
);
HRESULT
DSOUND_PrimaryPlay
(
DirectSoundDevice
*
device
);
...
...
dlls/dsound/primary.c
View file @
3bafbb22
...
@@ -36,36 +36,44 @@
...
@@ -36,36 +36,44 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dsound
);
WINE_DEFAULT_DEBUG_CHANNEL
(
dsound
);
static
void
DSOUND_RecalcPrimary
(
DirectSoundDevice
*
device
)
/** Calculate how long a fragment length of about 10 ms should be in frames
*
* nSamplesPerSec: Frequency rate in samples per second
* nBlockAlign: Size of a single blockalign
*
* Returns:
* Size in bytes of a single fragment
*/
DWORD
DSOUND_fraglen
(
DWORD
nSamplesPerSec
,
DWORD
nBlockAlign
)
{
{
DWORD
nBlockAlign
;
DWORD
fraglen
=
512
*
nBlockAlign
;
DWORD
fraglen
;
TRACE
(
"(%p)
\n
"
,
device
);
nBlockAlign
=
device
->
pwfx
->
nBlockAlign
;
/* Compensate for only being roughly accurate */
/* Alsa doesn't have continuous buffers, instead it has buffers with power of 2,
if
(
nSamplesPerSec
<=
26000
)
* If DS_TIME_DEL is about 10 ms, 512 * nBlockAlign is roughly correct */
fraglen
/=
2
;
fraglen
=
512
*
nBlockAlign
;
/* Compensate for only being roughly accurate */
if
(
nSamplesPerSec
<=
12000
)
if
(
device
->
pwfx
->
nSamplesPerSec
<=
26000
)
fraglen
/=
2
;
fraglen
/=
2
;
if
(
device
->
pwfx
->
nSamplesPerSec
<=
12
000
)
if
(
nSamplesPerSec
>=
80
000
)
fraglen
/
=
2
;
fraglen
*
=
2
;
if
(
device
->
pwfx
->
nSamplesPerSec
>=
80000
)
return
fraglen
;
fraglen
*=
2
;
}
static
void
DSOUND_RecalcPrimary
(
DirectSoundDevice
*
device
)
{
TRACE
(
"(%p)
\n
"
,
device
);
device
->
fraglen
=
fraglen
;
device
->
fraglen
=
DSOUND_fraglen
(
device
->
pwfx
->
nSamplesPerSec
,
device
->
pwfx
->
nBlockAlign
)
;
device
->
helfrags
=
device
->
buflen
/
fraglen
;
device
->
helfrags
=
device
->
buflen
/
device
->
fraglen
;
TRACE
(
"fraglen=%d helfrags=%d
\n
"
,
device
->
fraglen
,
device
->
helfrags
);
TRACE
(
"fraglen=%d helfrags=%d
\n
"
,
device
->
fraglen
,
device
->
helfrags
);
if
(
device
->
hwbuf
&&
device
->
drvdesc
.
dwFlags
&
DSDDESC_DONTNEEDWRITELEAD
)
if
(
device
->
hwbuf
&&
device
->
drvdesc
.
dwFlags
&
DSDDESC_DONTNEEDWRITELEAD
)
device
->
writelead
=
0
;
device
->
writelead
=
0
;
else
else
/* calculate the 10ms write lead */
/* calculate the 10ms write lead */
device
->
writelead
=
(
device
->
pwfx
->
nSamplesPerSec
/
100
)
*
nBlockAlign
;
device
->
writelead
=
(
device
->
pwfx
->
nSamplesPerSec
/
100
)
*
device
->
pwfx
->
nBlockAlign
;
}
}
HRESULT
DSOUND_ReopenDevice
(
DirectSoundDevice
*
device
,
BOOL
forcewave
)
HRESULT
DSOUND_ReopenDevice
(
DirectSoundDevice
*
device
,
BOOL
forcewave
)
...
...
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