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
341673f6
Commit
341673f6
authored
Jun 01, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Jun 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Lookup stream handler result using a dedicated helper.
parent
1069d479
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
48 deletions
+38
-48
media_source.c
dlls/winegstreamer/media_source.c
+38
-48
No files found.
dlls/winegstreamer/media_source.c
View file @
341673f6
...
...
@@ -1698,6 +1698,25 @@ struct stream_handler
CRITICAL_SECTION
cs
;
};
static
struct
result_entry
*
handler_find_result_entry
(
struct
stream_handler
*
handler
,
IMFAsyncResult
*
result
)
{
struct
result_entry
*
entry
;
EnterCriticalSection
(
&
handler
->
cs
);
LIST_FOR_EACH_ENTRY
(
entry
,
&
handler
->
results
,
struct
result_entry
,
entry
)
{
if
(
result
==
entry
->
result
)
{
list_remove
(
&
entry
->
entry
);
LeaveCriticalSection
(
&
handler
->
cs
);
return
entry
;
}
}
LeaveCriticalSection
(
&
handler
->
cs
);
return
NULL
;
}
static
struct
stream_handler
*
impl_from_IMFByteStreamHandler
(
IMFByteStreamHandler
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
stream_handler
,
IMFByteStreamHandler_iface
);
...
...
@@ -1884,71 +1903,42 @@ static HRESULT WINAPI stream_handler_BeginCreateObject(IMFByteStreamHandler *ifa
}
static
HRESULT
WINAPI
stream_handler_EndCreateObject
(
IMFByteStreamHandler
*
iface
,
IMFAsyncResult
*
result
,
MF_OBJECT_TYPE
*
obj_
type
,
IUnknown
**
object
)
MF_OBJECT_TYPE
*
type
,
IUnknown
**
object
)
{
struct
stream_handler
*
handler
=
impl_from_IMFByteStreamHandler
(
iface
);
struct
result_entry
*
found
=
NULL
,
*
cur
;
struct
result_entry
*
entry
;
HRESULT
hr
;
TRACE
(
"%p, %p, %p, %p.
\n
"
,
iface
,
result
,
obj_type
,
object
);
EnterCriticalSection
(
&
handler
->
cs
);
TRACE
(
"%p, %p, %p, %p.
\n
"
,
iface
,
result
,
type
,
object
);
LIST_FOR_EACH_ENTRY
(
cur
,
&
handler
->
results
,
struct
result_entry
,
entry
)
if
(
!
(
entry
=
handler_find_result_entry
(
handler
,
result
))
)
{
if
(
result
==
cur
->
result
)
{
list_remove
(
&
cur
->
entry
);
found
=
cur
;
break
;
}
}
LeaveCriticalSection
(
&
handler
->
cs
);
if
(
found
)
{
hr
=
IMFAsyncResult_GetStatus
(
found
->
result
);
*
obj_type
=
found
->
type
;
*
object
=
found
->
object
;
IUnknown_AddRef
(
*
object
);
result_entry_destroy
(
found
);
}
else
{
*
obj_type
=
MF_OBJECT_INVALID
;
*
type
=
MF_OBJECT_INVALID
;
*
object
=
NULL
;
hr
=
MF_E_UNEXPECTED
;
return
MF_E_UNEXPECTED
;
}
hr
=
IMFAsyncResult_GetStatus
(
entry
->
result
);
*
type
=
entry
->
type
;
*
object
=
entry
->
object
;
IUnknown_AddRef
(
*
object
);
result_entry_destroy
(
entry
);
return
hr
;
}
static
HRESULT
WINAPI
stream_handler_CancelObjectCreation
(
IMFByteStreamHandler
*
iface
,
IUnknown
*
c
ancel_c
ookie
)
static
HRESULT
WINAPI
stream_handler_CancelObjectCreation
(
IMFByteStreamHandler
*
iface
,
IUnknown
*
cookie
)
{
struct
stream_handler
*
handler
=
impl_from_IMFByteStreamHandler
(
iface
);
struct
result_entry
*
found
=
NULL
,
*
cur
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
cancel_cookie
);
EnterCriticalSection
(
&
handler
->
cs
);
LIST_FOR_EACH_ENTRY
(
cur
,
&
handler
->
results
,
struct
result_entry
,
entry
)
{
if
(
cancel_cookie
==
(
IUnknown
*
)
cur
->
result
)
{
list_remove
(
&
cur
->
entry
);
found
=
cur
;
break
;
}
}
IMFAsyncResult
*
result
=
(
IMFAsyncResult
*
)
cookie
;
struct
result_entry
*
entry
;
LeaveCriticalSection
(
&
handler
->
cs
);
TRACE
(
"%p, %p.
\n
"
,
iface
,
cookie
);
if
(
found
)
re
sult_entry_destroy
(
found
)
;
if
(
!
(
entry
=
handler_find_result_entry
(
handler
,
result
))
)
re
turn
MF_E_UNEXPECTED
;
return
found
?
S_OK
:
MF_E_UNEXPECTED
;
result_entry_destroy
(
entry
);
return
S_OK
;
}
static
HRESULT
WINAPI
stream_handler_GetMaxNumberOfBytesRequiredForResolution
(
IMFByteStreamHandler
*
iface
,
QWORD
*
bytes
)
...
...
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