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
68cc41ba
Commit
68cc41ba
authored
Sep 09, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Introduce a new async_reader_wait_pts helper.
parent
524413cf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
18 deletions
+26
-18
wm_asyncreader.c
dlls/winegstreamer/wm_asyncreader.c
+26
-18
No files found.
dlls/winegstreamer/wm_asyncreader.c
View file @
68cc41ba
...
...
@@ -96,6 +96,31 @@ static DWORD async_reader_get_wait_timeout(struct async_reader *reader, QWORD pt
return
pts
>
current_time
?
timeout
:
0
;
}
static
bool
async_reader_wait_pts
(
struct
async_reader
*
reader
,
QWORD
pts
)
{
IWMReaderCallbackAdvanced
*
callback_advanced
=
reader
->
callback_advanced
;
DWORD
timeout
;
TRACE
(
"reader %p, pts %I64d.
\n
"
,
reader
,
pts
);
if
(
reader
->
user_clock
&&
pts
>
reader
->
user_time
&&
callback_advanced
)
{
QWORD
user_time
=
reader
->
user_time
;
LeaveCriticalSection
(
&
reader
->
callback_cs
);
IWMReaderCallbackAdvanced_OnTime
(
callback_advanced
,
user_time
,
reader
->
context
);
EnterCriticalSection
(
&
reader
->
callback_cs
);
}
while
(
reader
->
running
&&
list_empty
(
&
reader
->
async_ops
))
{
if
(
!
(
timeout
=
async_reader_get_wait_timeout
(
reader
,
pts
)))
return
true
;
SleepConditionVariableCS
(
&
reader
->
callback_cv
,
&
reader
->
callback_cs
,
timeout
);
}
return
false
;
}
static
void
callback_thread_run
(
struct
async_reader
*
reader
)
{
IWMReaderCallbackAdvanced
*
callback_advanced
=
reader
->
callback_advanced
;
...
...
@@ -110,8 +135,6 @@ static void callback_thread_run(struct async_reader *reader)
while
(
reader
->
running
&&
list_empty
(
&
reader
->
async_ops
))
{
DWORD
timeout
;
LeaveCriticalSection
(
&
reader
->
callback_cs
);
hr
=
wm_reader_get_stream_sample
(
&
reader
->
reader
,
callback_advanced
,
0
,
&
sample
,
&
pts
,
&
duration
,
&
flags
,
&
stream_number
);
EnterCriticalSection
(
&
reader
->
callback_cs
);
...
...
@@ -120,22 +143,7 @@ static void callback_thread_run(struct async_reader *reader)
stream
=
wm_reader_get_stream_by_stream_number
(
&
reader
->
reader
,
stream_number
);
if
(
reader
->
user_clock
&&
pts
>
reader
->
user_time
&&
callback_advanced
)
{
QWORD
user_time
=
reader
->
user_time
;
LeaveCriticalSection
(
&
reader
->
callback_cs
);
IWMReaderCallbackAdvanced_OnTime
(
callback_advanced
,
user_time
,
reader
->
context
);
EnterCriticalSection
(
&
reader
->
callback_cs
);
}
while
(
reader
->
running
&&
list_empty
(
&
reader
->
async_ops
))
{
if
(
!
(
timeout
=
async_reader_get_wait_timeout
(
reader
,
pts
)))
break
;
SleepConditionVariableCS
(
&
reader
->
callback_cv
,
&
reader
->
callback_cs
,
timeout
);
}
if
(
reader
->
running
&&
list_empty
(
&
reader
->
async_ops
))
if
(
async_reader_wait_pts
(
reader
,
pts
))
{
LeaveCriticalSection
(
&
reader
->
callback_cs
);
if
(
stream
->
read_compressed
)
...
...
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