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
b32b1a92
Commit
b32b1a92
authored
Jan 16, 2012
by
Aric Stewart
Committed by
Alexandre Julliard
Jan 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: In the TransformFilter add a critical section that protects the streaming state.
parent
9aa3c745
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
transform.c
dlls/strmbase/transform.c
+15
-10
strmbase.h
include/wine/strmbase.h
+1
-0
No files found.
dlls/strmbase/transform.c
View file @
b32b1a92
...
...
@@ -68,25 +68,25 @@ static HRESULT WINAPI TransformFilter_Input_Receive(BaseInputPin *This, IMediaSa
TRACE
(
"%p
\n
"
,
This
);
pTransform
=
(
TransformFilter
*
)
This
->
pin
.
pinInfo
.
pFilter
;
EnterCriticalSection
(
&
pTransform
->
filter
.
csFilter
);
EnterCriticalSection
(
&
pTransform
->
csReceive
);
if
(
pTransform
->
filter
.
state
==
State_Stopped
)
{
LeaveCriticalSection
(
&
pTransform
->
filter
.
csFilter
);
LeaveCriticalSection
(
&
pTransform
->
csReceive
);
return
VFW_E_WRONG_STATE
;
}
if
(
This
->
end_of_stream
||
This
->
flushing
)
{
LeaveCriticalSection
(
&
pTransform
->
filter
.
csFilter
);
LeaveCriticalSection
(
&
pTransform
->
csReceive
);
return
S_FALSE
;
}
LeaveCriticalSection
(
&
pTransform
->
filter
.
csFilter
);
if
(
pTransform
->
pFuncsTable
->
pfnReceive
)
hr
=
pTransform
->
pFuncsTable
->
pfnReceive
(
pTransform
,
pInSample
);
else
hr
=
S_FALSE
;
LeaveCriticalSection
(
&
pTransform
->
csReceive
);
return
hr
;
}
...
...
@@ -176,6 +176,9 @@ static HRESULT TransformFilter_Init(const IBaseFilterVtbl *pVtbl, const CLSID* p
BaseFilter_Init
(
&
pTransformFilter
->
filter
,
pVtbl
,
pClsid
,
(
DWORD_PTR
)(
__FILE__
": TransformFilter.csFilter"
),
&
tfBaseFuncTable
);
InitializeCriticalSection
(
&
pTransformFilter
->
csReceive
);
pTransformFilter
->
csReceive
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": TransformFilter.csReceive"
);
/* pTransformFilter is already allocated */
pTransformFilter
->
pFuncsTable
=
pFuncsTable
;
ZeroMemory
(
&
pTransformFilter
->
pmt
,
sizeof
(
pTransformFilter
->
pmt
));
...
...
@@ -286,6 +289,8 @@ ULONG WINAPI TransformFilterImpl_Release(IBaseFilter * iface)
CoTaskMemFree
(
This
->
ppPins
);
TRACE
(
"Destroying transform filter
\n
"
);
This
->
csReceive
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
csReceive
);
FreeMediaType
(
&
This
->
pmt
);
CoTaskMemFree
(
This
);
...
...
@@ -304,13 +309,13 @@ HRESULT WINAPI TransformFilterImpl_Stop(IBaseFilter * iface)
TRACE
(
"(%p/%p)
\n
"
,
This
,
iface
);
EnterCriticalSection
(
&
This
->
filter
.
csFilter
);
EnterCriticalSection
(
&
This
->
csReceive
);
{
This
->
filter
.
state
=
State_Stopped
;
if
(
This
->
pFuncsTable
->
pfnStopStreaming
)
hr
=
This
->
pFuncsTable
->
pfnStopStreaming
(
This
);
}
LeaveCriticalSection
(
&
This
->
filter
.
csFilter
);
LeaveCriticalSection
(
&
This
->
csReceive
);
return
hr
;
}
...
...
@@ -322,7 +327,7 @@ HRESULT WINAPI TransformFilterImpl_Pause(IBaseFilter * iface)
TRACE
(
"(%p/%p)->()
\n
"
,
This
,
iface
);
EnterCriticalSection
(
&
This
->
filter
.
csFilter
);
EnterCriticalSection
(
&
This
->
csReceive
);
{
if
(
This
->
filter
.
state
==
State_Stopped
)
hr
=
IBaseFilter_Run
(
iface
,
-
1
);
...
...
@@ -332,7 +337,7 @@ HRESULT WINAPI TransformFilterImpl_Pause(IBaseFilter * iface)
if
(
SUCCEEDED
(
hr
))
This
->
filter
.
state
=
State_Paused
;
}
LeaveCriticalSection
(
&
This
->
filter
.
csFilter
);
LeaveCriticalSection
(
&
This
->
csReceive
);
return
hr
;
}
...
...
@@ -344,7 +349,7 @@ HRESULT WINAPI TransformFilterImpl_Run(IBaseFilter * iface, REFERENCE_TIME tStar
TRACE
(
"(%p/%p)->(%s)
\n
"
,
This
,
iface
,
wine_dbgstr_longlong
(
tStart
));
EnterCriticalSection
(
&
This
->
filter
.
csFilter
);
EnterCriticalSection
(
&
This
->
csReceive
);
{
if
(
This
->
filter
.
state
==
State_Stopped
)
{
...
...
@@ -361,7 +366,7 @@ HRESULT WINAPI TransformFilterImpl_Run(IBaseFilter * iface, REFERENCE_TIME tStar
This
->
filter
.
state
=
State_Running
;
}
}
LeaveCriticalSection
(
&
This
->
filter
.
csFilter
);
LeaveCriticalSection
(
&
This
->
csReceive
);
return
hr
;
}
...
...
include/wine/strmbase.h
View file @
b32b1a92
...
...
@@ -232,6 +232,7 @@ typedef struct TransformFilter
IPin
**
ppPins
;
ULONG
npins
;
AM_MEDIA_TYPE
pmt
;
CRITICAL_SECTION
csReceive
;
const
struct
TransformFilterFuncTable
*
pFuncsTable
;
QualityControlImpl
qcimpl
;
...
...
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