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
36e90546
Commit
36e90546
authored
Jul 29, 2007
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Aug 02, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Move resampling away from mixer thread.
parent
1ad6abfb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
103 additions
and
60 deletions
+103
-60
buffer.c
dlls/dsound/buffer.c
+77
-48
dsound_private.h
dlls/dsound/dsound_private.h
+15
-6
mixer.c
dlls/dsound/mixer.c
+0
-0
primary.c
dlls/dsound/primary.c
+8
-5
sound3d.c
dlls/dsound/sound3d.c
+3
-1
No files found.
dlls/dsound/buffer.c
View file @
36e90546
This diff is collapsed.
Click to expand it.
dlls/dsound/dsound_private.h
View file @
36e90546
...
...
@@ -23,6 +23,8 @@
#define DS_TIME_RES 2
/* Resolution of multimedia timer */
#define DS_TIME_DEL 10
/* Delay of multimedia timer callback, and duration of HEL fragment */
#include "wine/list.h"
/* direct sound hardware acceleration levels */
#define DS_HW_ACCEL_FULL 0
/* default on Windows 98 */
#define DS_HW_ACCEL_STANDARD 1
/* default on Windows 2000 */
...
...
@@ -108,6 +110,7 @@ typedef struct BufferMemory
{
LONG
ref
;
LPBYTE
memory
;
struct
list
buffers
;
}
BufferMemory
;
ULONG
DirectSoundDevice_Release
(
DirectSoundDevice
*
device
);
...
...
@@ -159,16 +162,17 @@ struct IDirectSoundBufferImpl
PIDSDRIVERBUFFER
hwbuf
;
PWAVEFORMATEX
pwfx
;
BufferMemory
*
buffer
;
LPBYTE
tmp_buffer
;
DWORD
playflags
,
state
,
leadin
;
DWORD
startpos
,
writelead
,
buflen
;
DWORD
writelead
,
buflen
;
DWORD
nAvgBytesPerSec
;
DWORD
freq
;
DWORD
freq
,
tmp_buffer_len
,
max_buffer_len
;
DSVOLUMEPAN
volpan
;
DSBUFFERDESC
dsbd
;
/* used for frequency conversion (PerfectPitch) */
ULONG
freq
Adjust
,
freqAcc
;
/* used for
intelligent (well, sort of) prebuffer
ing */
DWORD
primary_mixpos
,
buf_mixpos
;
ULONG
freq
needed
,
freqAdjust
,
freqAcc
,
freqAccNext
;
/* used for
mix
ing */
DWORD
primary_mixpos
,
buf_mixpos
,
sec_mixpos
;
/* IDirectSoundNotifyImpl fields */
IDirectSoundNotifyImpl
*
notify
;
...
...
@@ -184,6 +188,8 @@ struct IDirectSoundBufferImpl
/* IKsPropertySet fields */
IKsBufferPropertySetImpl
*
iks
;
struct
list
entry
;
};
HRESULT
IDirectSoundBufferImpl_Create
(
...
...
@@ -431,6 +437,9 @@ void DSOUND_CheckEvent(const IDirectSoundBufferImpl *dsb, DWORD playpos, int len
void
DSOUND_RecalcVolPan
(
PDSVOLUMEPAN
volpan
);
void
DSOUND_AmpFactorToVolPan
(
PDSVOLUMEPAN
volpan
);
void
DSOUND_RecalcFormat
(
IDirectSoundBufferImpl
*
dsb
);
void
DSOUND_MixToTemporary
(
const
IDirectSoundBufferImpl
*
dsb
,
DWORD
writepos
,
DWORD
mixlen
);
DWORD
DSOUND_secpos_to_bufpos
(
const
IDirectSoundBufferImpl
*
dsb
,
DWORD
secpos
,
DWORD
secmixpos
,
DWORD
*
overshot
);
void
CALLBACK
DSOUND_timer
(
UINT
timerID
,
UINT
msg
,
DWORD_PTR
dwUser
,
DWORD_PTR
dw1
,
DWORD_PTR
dw2
);
void
CALLBACK
DSOUND_callback
(
HWAVEOUT
hwo
,
UINT
msg
,
DWORD
dwUser
,
DWORD
dw1
,
DWORD
dw2
);
...
...
@@ -460,7 +469,7 @@ HRESULT WINAPI IDirectSoundCaptureImpl_Initialize(
#define STATE_CAPTURING 2
#define STATE_STOPPING 3
#define DSOUND_FREQSHIFT (
14
)
#define DSOUND_FREQSHIFT (
20
)
extern
DirectSoundDevice
*
DSOUND_renderer
[
MAXWAVEDRIVERS
];
extern
GUID
DSOUND_renderer_guids
[
MAXWAVEDRIVERS
];
...
...
dlls/dsound/mixer.c
View file @
36e90546
This diff is collapsed.
Click to expand it.
dlls/dsound/primary.c
View file @
36e90546
...
...
@@ -378,7 +378,7 @@ HRESULT DSOUND_PrimarySetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex)
{
HRESULT
err
=
DS_OK
;
int
i
,
alloc_size
,
cp_size
;
DWORD
nSamplesPerSec
;
DWORD
nSamplesPerSec
,
bpp
,
chans
;
TRACE
(
"(%p,%p)
\n
"
,
device
,
wfex
);
if
(
device
->
priolevel
==
DSSCL_NORMAL
)
{
...
...
@@ -410,6 +410,8 @@ HRESULT DSOUND_PrimarySetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex)
device
->
pwfx
=
HeapReAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
device
->
pwfx
,
alloc_size
);
nSamplesPerSec
=
device
->
pwfx
->
nSamplesPerSec
;
bpp
=
device
->
pwfx
->
wBitsPerSample
;
chans
=
device
->
pwfx
->
nChannels
;
CopyMemory
(
device
->
pwfx
,
wfex
,
cp_size
);
...
...
@@ -459,14 +461,15 @@ HRESULT DSOUND_PrimarySetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex)
DSOUND_RecalcPrimary
(
device
);
}
if
(
nSamplesPerSec
!=
device
->
pwfx
->
nSamplesPerSec
)
{
if
(
nSamplesPerSec
!=
device
->
pwfx
->
nSamplesPerSec
||
bpp
!=
device
->
pwfx
->
wBitsPerSample
||
chans
!=
device
->
pwfx
->
nChannels
)
{
IDirectSoundBufferImpl
**
dsb
=
device
->
buffers
;
for
(
i
=
0
;
i
<
device
->
nrofbuffers
;
i
++
,
dsb
++
)
{
/* **** */
RtlAcquireResourceExclusive
(
&
(
*
dsb
)
->
lock
,
TRUE
);
(
*
dsb
)
->
freqAdjust
=
((
*
dsb
)
->
freq
<<
DSOUND_FREQSHIFT
)
/
wfex
->
nSamplesPerSec
;
(
*
dsb
)
->
freqAdjust
=
((
DWORD64
)(
*
dsb
)
->
freq
<<
DSOUND_FREQSHIFT
)
/
device
->
pwfx
->
nSamplesPerSec
;
DSOUND_RecalcFormat
((
*
dsb
));
DSOUND_MixToTemporary
((
*
dsb
),
0
,
(
*
dsb
)
->
buflen
);
RtlReleaseResource
(
&
(
*
dsb
)
->
lock
);
/* **** */
...
...
@@ -769,7 +772,7 @@ static HRESULT WINAPI PrimaryBufferImpl_Lock(
writecursor
,
device
->
buflen
);
return
DSERR_INVALIDPARAM
;
}
if
(
writebytes
>
device
->
buflen
)
{
WARN
(
"Invalid parameter, writebytes: %u > buflen: %u
\n
"
,
writebytes
,
device
->
buflen
);
...
...
dlls/dsound/sound3d.c
View file @
36e90546
...
...
@@ -279,7 +279,7 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb)
{
TRACE("doppler: Buffer and Listener don't have velocities\n");
}
else
else
if (ds3db_ds3db.vVelocity != dsb->device->ds3dl.vVelocity)
{
/* calculate length of ds3db_ds3db.vVelocity component which causes Doppler Effect
NOTE: if buffer moves TOWARDS the listener, it's velocity component is NEGATIVE
...
...
@@ -296,6 +296,8 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb)
dsb->freq, flFreq);
/* FIXME: replace following line with correct frequency setting ! */
dsb->freq = flFreq;
DSOUND_RecalcFormat(dsb);
DSOUND_MixToTemporary(dsb, 0, dsb->buflen);
}
#endif
...
...
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