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
b2d20154
Commit
b2d20154
authored
Oct 21, 2008
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Oct 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Implement dynamic format changing in directsound renderer.
parent
ca0db588
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
dsoundrender.c
dlls/quartz/dsoundrender.c
+34
-0
No files found.
dlls/quartz/dsoundrender.c
View file @
b2d20154
...
...
@@ -238,6 +238,7 @@ static HRESULT DSoundRender_Sample(LPVOID iface, IMediaSample * pSample)
long
cbSrcStream
=
0
;
REFERENCE_TIME
tStart
,
tStop
;
HRESULT
hr
;
AM_MEDIA_TYPE
*
amt
;
TRACE
(
"%p %p
\n
"
,
iface
,
pSample
);
...
...
@@ -259,6 +260,39 @@ static HRESULT DSoundRender_Sample(LPVOID iface, IMediaSample * pSample)
return
VFW_E_WRONG_STATE
;
}
if
(
IMediaSample_GetMediaType
(
pSample
,
&
amt
)
==
S_OK
)
{
AM_MEDIA_TYPE
*
orig
=
&
This
->
pInputPin
->
pin
.
mtCurrent
;
WAVEFORMATEX
*
origfmt
=
(
WAVEFORMATEX
*
)
orig
->
pbFormat
;
WAVEFORMATEX
*
newfmt
=
(
WAVEFORMATEX
*
)
amt
->
pbFormat
;
if
(
origfmt
->
wFormatTag
==
newfmt
->
wFormatTag
&&
origfmt
->
nChannels
==
newfmt
->
nChannels
&&
origfmt
->
nBlockAlign
==
newfmt
->
nBlockAlign
&&
origfmt
->
wBitsPerSample
==
newfmt
->
wBitsPerSample
&&
origfmt
->
cbSize
==
newfmt
->
cbSize
)
{
if
(
origfmt
->
nSamplesPerSec
!=
newfmt
->
nSamplesPerSec
)
{
hr
=
IDirectSoundBuffer_SetFrequency
(
This
->
dsbuffer
,
newfmt
->
nSamplesPerSec
);
if
(
FAILED
(
hr
))
{
LeaveCriticalSection
(
&
This
->
csFilter
);
return
VFW_E_TYPE_NOT_ACCEPTED
;
}
FreeMediaType
(
orig
);
CopyMediaType
(
orig
,
amt
);
IMediaSample_SetMediaType
(
pSample
,
NULL
);
}
}
else
{
LeaveCriticalSection
(
&
This
->
csFilter
);
return
VFW_E_TYPE_NOT_ACCEPTED
;
}
}
SetEvent
(
This
->
state_change
);
hr
=
IMediaSample_GetPointer
(
pSample
,
&
pbSrcStream
);
...
...
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