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
9643fcb4
Commit
9643fcb4
authored
Feb 21, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input: merge "interface" and "statistics" updates
parent
ec0c77b9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
23 deletions
+11
-23
src/input/input.c
src/input/input.c
+11
-23
No files found.
src/input/input.c
View file @
9643fcb4
...
@@ -636,10 +636,9 @@ static int MainLoopTryRepeat( input_thread_t *p_input, mtime_t *pi_start_mdate )
...
@@ -636,10 +636,9 @@ static int MainLoopTryRepeat( input_thread_t *p_input, mtime_t *pi_start_mdate )
}
}
/**
/**
* MainLoopInterface
* Update timing infos and statistics.
* It update the variables used by the interfaces
*/
*/
static
void
MainLoop
Interface
(
input_thread_t
*
p_input
)
static
void
MainLoop
Statistics
(
input_thread_t
*
p_input
)
{
{
double
f_position
=
0
.
0
;
double
f_position
=
0
.
0
;
mtime_t
i_time
=
0
;
mtime_t
i_time
=
0
;
...
@@ -666,14 +665,7 @@ static void MainLoopInterface( input_thread_t *p_input )
...
@@ -666,14 +665,7 @@ static void MainLoopInterface( input_thread_t *p_input )
p_input
->
p
->
bookmark
.
i_time_offset
=
i_time
;
p_input
->
p
->
bookmark
.
i_time_offset
=
i_time
;
p_input
->
p
->
bookmark
.
i_byte_offset
=
-
1
;
p_input
->
p
->
bookmark
.
i_byte_offset
=
-
1
;
vlc_mutex_unlock
(
&
p_input
->
p
->
p_item
->
lock
);
vlc_mutex_unlock
(
&
p_input
->
p
->
p_item
->
lock
);
}
/**
* MainLoopStatistic
* It updates the globals statics
*/
static
void
MainLoopStatistic
(
input_thread_t
*
p_input
)
{
stats_ComputeInputStats
(
p_input
,
p_input
->
p
->
p_item
->
p_stats
);
stats_ComputeInputStats
(
p_input
,
p_input
->
p
->
p_item
->
p_stats
);
input_SendEventStatistics
(
p_input
);
input_SendEventStatistics
(
p_input
);
}
}
...
@@ -686,7 +678,6 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
...
@@ -686,7 +678,6 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
{
{
mtime_t
i_start_mdate
=
mdate
();
mtime_t
i_start_mdate
=
mdate
();
mtime_t
i_intf_update
=
0
;
mtime_t
i_intf_update
=
0
;
mtime_t
i_statistic_update
=
0
;
mtime_t
i_last_seek_mdate
=
0
;
mtime_t
i_last_seek_mdate
=
0
;
bool
b_pause_after_eof
=
b_interactive
&&
bool
b_pause_after_eof
=
b_interactive
&&
var_CreateGetBool
(
p_input
,
"play-and-pause"
);
var_CreateGetBool
(
p_input
,
"play-and-pause"
);
...
@@ -695,7 +686,7 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
...
@@ -695,7 +686,7 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
{
{
bool
b_force_update
;
bool
b_force_update
;
vlc_value_t
val
;
vlc_value_t
val
;
mtime_t
i_wakeup
,
i_current
;
mtime_t
i_wakeup
;
bool
b_paused
;
bool
b_paused
;
bool
b_demux_polled
;
bool
b_demux_polled
;
...
@@ -741,10 +732,12 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
...
@@ -741,10 +732,12 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
}
}
/* */
/* */
mtime_t
now
;
do
{
do
{
mtime_t
i_deadline
=
i_wakeup
;
mtime_t
i_deadline
=
i_wakeup
;
if
(
b_paused
||
!
b_demux_polled
)
if
(
b_paused
||
!
b_demux_polled
)
i_deadline
=
__MIN
(
i_intf_update
,
i_statistic_update
)
;
i_deadline
=
i_intf_update
;
/* Handle control */
/* Handle control */
for
(
;;
)
for
(
;;
)
...
@@ -785,23 +778,18 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
...
@@ -785,23 +778,18 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
}
}
/* Update interface and statistics */
/* Update interface and statistics */
i_current
=
mdate
();
now
=
mdate
();
if
(
i_intf_update
<
i_current
||
b_force_update
)
if
(
now
>=
i_intf_update
||
b_force_update
)
{
{
MainLoop
Interface
(
p_input
);
MainLoop
Statistics
(
p_input
);
i_intf_update
=
i_current
+
INT64_C
(
250000
);
i_intf_update
=
now
+
INT64_C
(
250000
);
b_force_update
=
false
;
b_force_update
=
false
;
}
}
if
(
i_statistic_update
<
i_current
)
{
MainLoopStatistic
(
p_input
);
i_statistic_update
=
i_current
+
CLOCK_FREQ
;
}
/* Update the wakeup time */
/* Update the wakeup time */
if
(
i_wakeup
!=
0
)
if
(
i_wakeup
!=
0
)
i_wakeup
=
es_out_GetWakeup
(
p_input
->
p
->
p_es_out
);
i_wakeup
=
es_out_GetWakeup
(
p_input
->
p
->
p_es_out
);
}
while
(
i_current
<
i_wakeup
);
}
while
(
now
<
i_wakeup
);
}
}
if
(
!
p_input
->
b_error
)
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