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
eca0e8bb
Commit
eca0e8bb
authored
Mar 13, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfreadwrite: Keep source reference in source reader.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e3b048c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
main.c
dlls/mfreadwrite/main.c
+14
-10
No files found.
dlls/mfreadwrite/main.c
View file @
eca0e8bb
...
...
@@ -70,10 +70,11 @@ HRESULT WINAPI DllUnregisterServer(void)
return
__wine_unregister_resources
(
mfinstance
);
}
typedef
struct
_src
reader
typedef
struct
source_
reader
{
IMFSourceReader
IMFSourceReader_iface
;
LONG
ref
;
LONG
refcount
;
IMFMediaSource
*
source
;
}
srcreader
;
struct
sink_writer
...
...
@@ -117,7 +118,7 @@ static HRESULT WINAPI src_reader_QueryInterface(IMFSourceReader *iface, REFIID r
static
ULONG
WINAPI
src_reader_AddRef
(
IMFSourceReader
*
iface
)
{
srcreader
*
This
=
impl_from_IMFSourceReader
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
count
);
TRACE
(
"(%p) ref=%u
\n
"
,
This
,
ref
);
...
...
@@ -126,17 +127,18 @@ static ULONG WINAPI src_reader_AddRef(IMFSourceReader *iface)
static
ULONG
WINAPI
src_reader_Release
(
IMFSourceReader
*
iface
)
{
s
rcreader
*
This
=
impl_from_IMFSourceReader
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
s
truct
source_reader
*
reader
=
impl_from_IMFSourceReader
(
iface
);
ULONG
ref
count
=
InterlockedDecrement
(
&
reader
->
refcount
);
TRACE
(
"
(%p) ref=%u
\n
"
,
This
,
ref
);
TRACE
(
"
%p, refcount %d.
\n
"
,
iface
,
refcount
);
if
(
!
ref
)
if
(
!
ref
count
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
IMFMediaSource_Release
(
reader
->
source
);
heap_free
(
reader
);
}
return
ref
;
return
ref
count
;
}
static
HRESULT
WINAPI
src_reader_GetStreamSelection
(
IMFSourceReader
*
iface
,
DWORD
index
,
BOOL
*
selected
)
...
...
@@ -244,7 +246,9 @@ static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttri
return
E_OUTOFMEMORY
;
object
->
IMFSourceReader_iface
.
lpVtbl
=
&
srcreader_vtbl
;
object
->
ref
=
1
;
object
->
refcount
=
1
;
object
->
source
=
source
;
IMFMediaSource_AddRef
(
object
->
source
);
hr
=
IMFSourceReader_QueryInterface
(
&
object
->
IMFSourceReader_iface
,
riid
,
out
);
IMFSourceReader_Release
(
&
object
->
IMFSourceReader_iface
);
...
...
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