Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5a9450db
Commit
5a9450db
authored
Jun 19, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Jun 28, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Keep the caller result in create_object_context.
parent
70efc785
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
32 deletions
+20
-32
media_source.c
dlls/winegstreamer/media_source.c
+20
-32
No files found.
dlls/winegstreamer/media_source.c
View file @
5a9450db
...
...
@@ -1779,6 +1779,7 @@ struct create_object_context
IUnknown
IUnknown_iface
;
LONG
refcount
;
IMFAsyncResult
*
result
;
IMFByteStream
*
stream
;
WCHAR
*
url
;
};
...
...
@@ -1823,6 +1824,7 @@ static ULONG WINAPI create_object_context_Release(IUnknown *iface)
if
(
!
refcount
)
{
IMFAsyncResult_Release
(
context
->
result
);
IMFByteStream_Release
(
context
->
stream
);
free
(
context
->
url
);
free
(
context
);
...
...
@@ -1843,7 +1845,7 @@ static HRESULT WINAPI stream_handler_BeginCreateObject(IMFByteStreamHandler *ifa
{
struct
stream_handler
*
handler
=
impl_from_IMFByteStreamHandler
(
iface
);
struct
create_object_context
*
context
;
IMFAsyncResult
*
caller
,
*
item
;
IMFAsyncResult
*
result
;
HRESULT
hr
;
TRACE
(
"%p, %s, %#lx, %p, %p, %p, %p.
\n
"
,
iface
,
debugstr_w
(
url
),
flags
,
props
,
cancel_cookie
,
callback
,
state
);
...
...
@@ -1856,12 +1858,12 @@ static HRESULT WINAPI stream_handler_BeginCreateObject(IMFByteStreamHandler *ifa
if
(
flags
!=
MF_RESOLUTION_MEDIASOURCE
)
FIXME
(
"Unimplemented flags %#lx
\n
"
,
flags
);
if
(
FAILED
(
hr
=
MFCreateAsyncResult
(
NULL
,
callback
,
state
,
&
caller
)))
if
(
FAILED
(
hr
=
MFCreateAsyncResult
(
NULL
,
callback
,
state
,
&
result
)))
return
hr
;
if
(
!
(
context
=
calloc
(
1
,
sizeof
(
*
context
))))
{
IMFAsyncResult_Release
(
caller
);
IMFAsyncResult_Release
(
result
);
return
E_OUTOFMEMORY
;
}
...
...
@@ -1869,25 +1871,21 @@ static HRESULT WINAPI stream_handler_BeginCreateObject(IMFByteStreamHandler *ifa
context
->
refcount
=
1
;
context
->
stream
=
stream
;
IMFByteStream_AddRef
(
context
->
stream
);
context
->
result
=
result
;
IMFAsyncResult_AddRef
(
context
->
result
);
if
(
url
)
context
->
url
=
wcsdup
(
url
);
hr
=
MF
CreateAsyncResult
(
&
context
->
IUnknown_iface
,
&
handler
->
IMFAsyncCallback_iface
,
(
IUnknown
*
)
caller
,
&
item
);
hr
=
MF
PutWorkItem
(
MFASYNC_CALLBACK_QUEUE_IO
,
&
handler
->
IMFAsyncCallback_iface
,
&
context
->
IUnknown_iface
);
IUnknown_Release
(
&
context
->
IUnknown_iface
);
if
(
SUCCEEDED
(
hr
))
{
if
(
SUCCEEDED
(
hr
=
MFPutWorkItemEx
(
MFASYNC_CALLBACK_QUEUE_IO
,
item
)))
{
if
(
cancel_cookie
)
{
*
cancel_cookie
=
(
IUnknown
*
)
caller
;
IUnknown_AddRef
(
*
cancel_cookie
);
}
}
IMFAsyncResult_Release
(
item
);
if
(
SUCCEEDED
(
hr
)
&&
cancel_cookie
)
{
*
cancel_cookie
=
(
IUnknown
*
)
result
;
IUnknown_AddRef
(
*
cancel_cookie
);
}
IMFAsyncResult_Release
(
caller
);
IMFAsyncResult_Release
(
result
);
return
hr
;
}
...
...
@@ -1983,27 +1981,19 @@ static HRESULT WINAPI stream_handler_callback_GetParameters(IMFAsyncCallback *if
static
HRESULT
WINAPI
stream_handler_callback_Invoke
(
IMFAsyncCallback
*
iface
,
IMFAsyncResult
*
result
)
{
struct
stream_handler
*
handler
=
impl_from_IMFAsyncCallback
(
iface
);
IUnknown
*
object
,
*
context_object
;
IUnknown
*
object
,
*
state
=
IMFAsyncResult_GetStateNoAddRef
(
result
)
;
struct
create_object_context
*
context
;
struct
result_entry
*
entry
;
IMFAsyncResult
*
caller
;
HRESULT
hr
;
caller
=
(
IMFAsyncResult
*
)
IMFAsyncResult_GetStateNoAddRef
(
result
);
if
(
FAILED
(
hr
=
IMFAsyncResult_GetObject
(
result
,
&
context_object
)))
{
WARN
(
"Expected context set for callee result.
\n
"
);
return
hr
;
}
context
=
impl_from_IUnknown
(
context_object
);
if
(
!
state
||
!
(
context
=
impl_from_IUnknown
(
state
)))
return
E_INVALIDARG
;
if
(
FAILED
(
hr
=
media_source_create
(
context
->
stream
,
(
IMFMediaSource
**
)
&
object
)))
WARN
(
"Failed to create media source, hr %#lx
\n
"
,
hr
);
else
{
if
(
FAILED
(
hr
=
result_entry_create
(
c
aller
,
MF_OBJECT_MEDIASOURCE
,
object
,
&
entry
)))
if
(
FAILED
(
hr
=
result_entry_create
(
c
ontext
->
result
,
MF_OBJECT_MEDIASOURCE
,
object
,
&
entry
)))
WARN
(
"Failed to create handler result, hr %#lx
\n
"
,
hr
);
else
{
...
...
@@ -2015,10 +2005,8 @@ static HRESULT WINAPI stream_handler_callback_Invoke(IMFAsyncCallback *iface, IM
IUnknown_Release
(
object
);
}
IUnknown_Release
(
&
context
->
IUnknown_iface
);
IMFAsyncResult_SetStatus
(
caller
,
hr
);
MFInvokeCallback
(
caller
);
IMFAsyncResult_SetStatus
(
context
->
result
,
hr
);
MFInvokeCallback
(
context
->
result
);
return
S_OK
;
}
...
...
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