Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
b32b1a92
Commit
b32b1a92
authored
13 years ago
by
Aric Stewart
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
strmbase: In the TransformFilter add a critical section that protects the streaming state.
parent
9aa3c745
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/strmbase/transform.c
+15
-10
15 additions, 10 deletions
dlls/strmbase/transform.c
include/wine/strmbase.h
+1
-0
1 addition, 0 deletions
include/wine/strmbase.h
with
16 additions
and
10 deletions
dlls/strmbase/transform.c
+
15
−
10
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
;
}
...
...
This diff is collapsed.
Click to expand it.
include/wine/strmbase.h
+
1
−
0
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment