Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
a40a621d
Commit
a40a621d
authored
Feb 21, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input: merge two level of loop for control requests
parent
7adcf5f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
38 deletions
+32
-38
src/input/input.c
src/input/input.c
+32
-38
No files found.
src/input/input.c
View file @
a40a621d
...
...
@@ -738,61 +738,55 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
}
}
/* */
mtime_t
now
;
do
{
/* Handle control */
for
(
;;
)
{
mtime_t
i_deadline
=
i_wakeup
;
if
(
b_paused
||
!
b_demux_polled
)
/* FIXME: remove this polling */
i_deadline
=
mdate
()
+
INT64_C
(
250000
);
/* Handle control */
for
(
;;
)
/* Postpone seeking until ES buffering is complete or at most
* 125 ms. */
bool
b_postpone
=
es_out_GetBuffering
(
p_input
->
p
->
p_es_out
)
&&
!
p_input
->
p
->
input
.
b_eof
;
if
(
b_postpone
)
{
mtime_t
i_limit
=
i_deadline
;
mtime_t
now
=
mdate
()
;
/* Postpone seeking until ES buffering is complete or at most
* 125 ms. */
bool
b_buffering
=
es_out_GetBuffering
(
p_input
->
p
->
p_es_out
)
&&
!
p_input
->
p
->
input
.
b_eof
;
if
(
b_buffering
)
{
mtime_t
now
=
mdate
();
/* Recheck ES buffer level every 20 ms when seeking */
if
(
now
<
i_last_seek_mdate
+
INT64_C
(
125000
)
&&
i_deadline
>
now
+
INT64_C
(
20000
)
)
i_limit
=
now
+
INT64_C
(
20000
);
}
/* Recheck ES buffer level every 20 ms when seeking */
if
(
now
<
i_last_seek_mdate
+
INT64_C
(
125000
)
&&
i_deadline
>
now
+
INT64_C
(
20000
)
)
i_deadline
=
now
+
INT64_C
(
20000
);
else
b_postpone
=
false
;
}
int
i_type
;
vlc_value_t
val
;
int
i_type
;
vlc_value_t
val
;
if
(
ControlPop
(
p_input
,
&
i_type
,
&
val
,
i_limit
,
b_buffering
)
)
{
if
(
b_buffering
&&
i_limit
<
i_deadli
ne
)
continue
;
break
;
}
if
(
ControlPop
(
p_input
,
&
i_type
,
&
val
,
i_deadline
,
b_postpone
)
)
{
if
(
b_postpo
ne
)
continue
;
break
;
/* Wake-up time reached */
}
#ifndef NDEBUG
msg_Dbg
(
p_input
,
"control type=%d"
,
i_type
);
msg_Dbg
(
p_input
,
"control type=%d"
,
i_type
);
#endif
if
(
Control
(
p_input
,
i_type
,
val
)
)
{
if
(
ControlIsSeekRequest
(
i_type
)
)
i_last_seek_mdate
=
mdate
();
i_intf_update
=
0
;
}
if
(
Control
(
p_input
,
i_type
,
val
)
)
{
if
(
ControlIsSeekRequest
(
i_type
)
)
i_last_seek_mdate
=
mdate
();
i_intf_update
=
0
;
}
/* Update the wakeup time */
now
=
mdate
();
if
(
i_wakeup
!=
0
)
i_wakeup
=
es_out_GetWakeup
(
p_input
->
p
->
p_es_out
);
}
while
(
now
<
i_wakeup
);
}
}
if
(
!
p_input
->
b_error
)
...
...
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