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
63e0b3a7
Commit
63e0b3a7
authored
Mar 25, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfreadwrite: Handle MEStreamTick event in source reader.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
66de5a8e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
6 deletions
+29
-6
main.c
dlls/mfreadwrite/main.c
+29
-6
No files found.
dlls/mfreadwrite/main.c
View file @
63e0b3a7
...
...
@@ -528,12 +528,17 @@ static HRESULT source_reader_media_sample_handler(struct source_reader *reader,
}
static
HRESULT
source_reader_media_stream_state_handler
(
struct
source_reader
*
reader
,
IMFMediaStream
*
stream
,
MediaEventType
event
)
IMFMediaEvent
*
event
)
{
MediaEventType
event_type
;
LONGLONG
timestamp
;
PROPVARIANT
value
;
unsigned
int
i
;
HRESULT
hr
;
DWORD
id
;
IMFMediaEvent_GetType
(
event
,
&
event_type
);
if
(
FAILED
(
hr
=
media_stream_get_id
(
stream
,
&
id
)))
{
WARN
(
"Unidentified stream %p, hr %#x.
\n
"
,
stream
,
hr
);
...
...
@@ -548,7 +553,7 @@ static HRESULT source_reader_media_stream_state_handler(struct source_reader *re
{
EnterCriticalSection
(
&
stream
->
cs
);
switch
(
event
)
switch
(
event
_type
)
{
case
MEEndOfStream
:
stream
->
state
=
STREAM_STATE_EOS
;
...
...
@@ -565,6 +570,16 @@ static HRESULT source_reader_media_stream_state_handler(struct source_reader *re
case
MEStreamStarted
:
stream
->
state
=
STREAM_STATE_READY
;
break
;
case
MEStreamTick
:
value
.
vt
=
VT_EMPTY
;
hr
=
SUCCEEDED
(
IMFMediaEvent_GetValue
(
event
,
&
value
))
&&
value
.
vt
==
VT_I8
?
S_OK
:
E_UNEXPECTED
;
timestamp
=
SUCCEEDED
(
hr
)
?
value
.
u
.
hVal
.
QuadPart
:
0
;
PropVariantClear
(
&
value
);
source_reader_queue_response
(
stream
,
hr
,
stream
->
index
,
MF_SOURCE_READERF_STREAMTICK
,
timestamp
,
NULL
);
WakeAllConditionVariable
(
&
stream
->
sample_event
);
break
;
default:
;
}
...
...
@@ -606,8 +621,9 @@ static HRESULT WINAPI source_reader_stream_events_callback_Invoke(IMFAsyncCallba
break
;
case
MEStreamSeeked
:
case
MEStreamStarted
:
case
MEStreamTick
:
case
MEEndOfStream
:
hr
=
source_reader_media_stream_state_handler
(
reader
,
stream
,
event
_type
);
hr
=
source_reader_media_stream_state_handler
(
reader
,
stream
,
event
);
break
;
default:
;
...
...
@@ -664,6 +680,13 @@ static ULONG WINAPI src_reader_AddRef(IMFSourceReader *iface)
return
refcount
;
}
static
void
source_reader_release_response
(
struct
stream_response
*
response
)
{
if
(
response
->
sample
)
IMFSample_Release
(
response
->
sample
);
heap_free
(
response
);
}
static
ULONG
WINAPI
src_reader_Release
(
IMFSourceReader
*
iface
)
{
struct
source_reader
*
reader
=
impl_from_IMFSourceReader
(
iface
);
...
...
@@ -697,10 +720,8 @@ static ULONG WINAPI src_reader_Release(IMFSourceReader *iface)
LIST_FOR_EACH_ENTRY_SAFE
(
ptr
,
next
,
&
stream
->
responses
,
struct
stream_response
,
entry
)
{
if
(
ptr
->
sample
)
IMFSample_Release
(
ptr
->
sample
);
list_remove
(
&
ptr
->
entry
);
heap_fre
e
(
ptr
);
source_reader_release_respons
e
(
ptr
);
}
}
heap_free
(
reader
->
streams
);
...
...
@@ -1231,6 +1252,8 @@ static HRESULT source_reader_read_sample(struct source_reader *reader, DWORD ind
*
sample
=
response
->
sample
;
if
(
*
sample
)
IMFSample_AddRef
(
*
sample
);
hr
=
response
->
status
;
source_reader_release_response
(
response
);
}
else
{
...
...
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