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
6b42b421
Commit
6b42b421
authored
May 04, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Privatize the stats computer
parent
067e6c37
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
10 deletions
+13
-10
include/vlc_main.h
include/vlc_main.h
+0
-1
src/input/input.c
src/input/input.c
+9
-8
src/libvlc-common.c
src/libvlc-common.c
+1
-1
src/libvlc.h
src/libvlc.h
+3
-0
No files found.
include/vlc_main.h
View file @
6b42b421
...
...
@@ -45,7 +45,6 @@ struct libvlc_int_t
playlist_t
*
p_playlist
;
///< playlist object
void
*
p_stats_computer
;
///< Input thread computing stats (needs cleanup)
global_stats_t
*
p_stats
;
///< Global statistics
/* There is no real reason to keep a list of items, but not to break
...
...
src/input/input.c
View file @
6b42b421
...
...
@@ -158,11 +158,10 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
* the global stats. Check if there is already someone doing this */
if
(
p_input
->
p_libvlc
->
p_stats
&&
!
b_quick
)
{
libvlc_priv_t
*
priv
=
libvlc_priv
(
p_input
->
p_libvlc
);
vlc_mutex_lock
(
&
p_input
->
p_libvlc
->
p_stats
->
lock
);
if
(
p_input
->
p_libvlc
->
p_stats_computer
==
NULL
)
{
p_input
->
p_libvlc
->
p_stats_computer
=
p_input
;
}
if
(
priv
->
p_stats_computer
==
NULL
)
priv
->
p_stats_computer
=
p_input
;
vlc_mutex_unlock
(
&
p_input
->
p_libvlc
->
p_stats
->
lock
);
}
...
...
@@ -779,10 +778,10 @@ static void MainLoop( input_thread_t *p_input )
{
stats_ComputeInputStats
(
p_input
,
p_input
->
p
->
input
.
p_item
->
p_stats
);
/* Are we the thread responsible for computing global stats ? */
if
(
p_input
->
p_libvlc
->
p_stats_computer
==
p_input
)
if
(
libvlc_priv
(
p_input
->
p_libvlc
)
->
p_stats_computer
==
p_input
)
{
stats_ComputeGlobalStats
(
p_input
->
p_libvlc
,
p_input
->
p_libvlc
->
p_stats
);
p_input
->
p_libvlc
->
p_stats
);
}
}
}
...
...
@@ -1345,13 +1344,15 @@ static void End( input_thread_t * p_input )
#define CL_CO( c ) stats_CounterClean( p_input->p->counters.p_##c ); p_input->p->counters.p_##c = NULL;
if
(
libvlc_stats
(
p_input
)
)
{
libvlc_priv_t
*
priv
=
libvlc_priv
(
p_input
->
p_libvlc
);
/* make sure we are up to date */
stats_ComputeInputStats
(
p_input
,
p_input
->
p
->
input
.
p_item
->
p_stats
);
if
(
p
_input
->
p_libvlc
->
p_stats_computer
==
p_input
)
if
(
p
riv
->
p_stats_computer
==
p_input
)
{
stats_ComputeGlobalStats
(
p_input
->
p_libvlc
,
p_input
->
p_libvlc
->
p_stats
);
p
_input
->
p_libvlc
->
p_stats_computer
=
NULL
;
p
riv
->
p_stats_computer
=
NULL
;
}
CL_CO
(
read_bytes
);
CL_CO
(
read_packets
);
...
...
src/libvlc-common.c
View file @
6b42b421
...
...
@@ -722,7 +722,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
return
VLC_ENOMEM
;
}
vlc_mutex_init
(
&
p_libvlc
->
p_stats
->
lock
);
p
_libvlc
->
p_stats_computer
=
NULL
;
p
riv
->
p_stats_computer
=
NULL
;
/* Init the array that holds every input item */
ARRAY_INIT
(
p_libvlc
->
input_items
);
...
...
src/libvlc.h
View file @
6b42b421
...
...
@@ -223,6 +223,9 @@ typedef struct libvlc_priv_t
int
i_timers
;
///< Number of timers
bool
b_stats
;
///< Whether to collect stats
void
*
p_stats_computer
;
///< Input thread computing stats
/// (needs cleanup)
module_t
*
p_memcpy_module
;
///< Fast memcpy plugin used
vlm_t
*
p_vlm
;
///< VLM if created from libvlc-common.c
vlc_object_t
*
p_interaction
;
///< interface interaction object
...
...
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