Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
3d729748
Commit
3d729748
authored
Feb 28, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove uninitialized and unsynchronized global stats
This could crash the input thread(s).
parent
b0075635
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
42 deletions
+0
-42
include/vlc_main.h
include/vlc_main.h
+0
-3
src/input/input.c
src/input/input.c
+0
-24
src/libvlc.c
src/libvlc.c
+0
-12
src/libvlc.h
src/libvlc.h
+0
-3
No files found.
include/vlc_main.h
View file @
3d729748
...
@@ -37,9 +37,6 @@ struct libvlc_int_t
...
@@ -37,9 +37,6 @@ struct libvlc_int_t
{
{
VLC_COMMON_MEMBERS
VLC_COMMON_MEMBERS
/* FIXME: this is only used by the logger module! */
global_stats_t
*
p_stats
;
///< Global statistics
/* Structure storing the action name / key associations */
/* Structure storing the action name / key associations */
struct
hotkey
struct
hotkey
{
{
...
...
src/input/input.c
View file @
3d729748
...
@@ -149,17 +149,6 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
...
@@ -149,17 +149,6 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
if
(
!
p_input
->
p
)
if
(
!
p_input
->
p
)
return
NULL
;
return
NULL
;
/* One "randomly" selected input thread is responsible for computing
* the global stats. Check if there is already someone doing this */
if
(
p_input
->
p_libvlc
->
p_stats
&&
!
b_quick
)
{
libvlc_priv_t
*
p_private
=
libvlc_priv
(
p_input
->
p_libvlc
);
vlc_mutex_lock
(
&
p_input
->
p_libvlc
->
p_stats
->
lock
);
if
(
p_private
->
p_stats_computer
==
NULL
)
p_private
->
p_stats_computer
=
p_input
;
vlc_mutex_unlock
(
&
p_input
->
p_libvlc
->
p_stats
->
lock
);
}
p_input
->
b_preparsing
=
b_quick
;
p_input
->
b_preparsing
=
b_quick
;
p_input
->
psz_header
=
psz_header
?
strdup
(
psz_header
)
:
NULL
;
p_input
->
psz_header
=
psz_header
?
strdup
(
psz_header
)
:
NULL
;
...
@@ -700,12 +689,6 @@ static void MainLoopInterface( input_thread_t *p_input )
...
@@ -700,12 +689,6 @@ static void MainLoopInterface( input_thread_t *p_input )
static
void
MainLoopStatistic
(
input_thread_t
*
p_input
)
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
);
/* Are we the thread responsible for computing global stats ? */
if
(
libvlc_priv
(
p_input
->
p_libvlc
)
->
p_stats_computer
==
p_input
)
{
stats_ComputeGlobalStats
(
p_input
->
p_libvlc
,
p_input
->
p_libvlc
->
p_stats
);
}
input_SendEventStatistics
(
p_input
);
input_SendEventStatistics
(
p_input
);
}
}
...
@@ -1324,13 +1307,6 @@ static void End( input_thread_t * p_input )
...
@@ -1324,13 +1307,6 @@ static void End( input_thread_t * p_input )
/* make sure we are up to date */
/* make sure we are up to date */
stats_ComputeInputStats
(
p_input
,
p_input
->
p
->
p_item
->
p_stats
);
stats_ComputeInputStats
(
p_input
,
p_input
->
p
->
p_item
->
p_stats
);
if
(
p_private
->
p_stats_computer
==
p_input
)
{
stats_ComputeGlobalStats
(
p_input
->
p_libvlc
,
p_input
->
p_libvlc
->
p_stats
);
/* FIXME how can it be thread safe ? */
p_private
->
p_stats_computer
=
NULL
;
}
CL_CO
(
read_bytes
);
CL_CO
(
read_bytes
);
CL_CO
(
read_packets
);
CL_CO
(
read_packets
);
CL_CO
(
demux_read
);
CL_CO
(
demux_read
);
...
...
src/libvlc.c
View file @
3d729748
...
@@ -791,16 +791,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
...
@@ -791,16 +791,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
priv
->
i_timers
=
0
;
priv
->
i_timers
=
0
;
priv
->
pp_timers
=
NULL
;
priv
->
pp_timers
=
NULL
;
/* Init stats */
p_libvlc
->
p_stats
=
(
global_stats_t
*
)
malloc
(
sizeof
(
global_stats_t
)
);
if
(
!
p_libvlc
->
p_stats
)
{
vlc_object_release
(
p_libvlc
);
return
VLC_ENOMEM
;
/* FIXME: leaks */
}
vlc_mutex_init
(
&
p_libvlc
->
p_stats
->
lock
);
priv
->
p_stats_computer
=
NULL
;
priv
->
i_last_input_id
=
0
;
/* Not very safe, should be removed */
priv
->
i_last_input_id
=
0
;
/* Not very safe, should be removed */
/*
/*
...
@@ -1080,8 +1070,6 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
...
@@ -1080,8 +1070,6 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
stats_TimersCleanAll
(
p_libvlc
);
stats_TimersCleanAll
(
p_libvlc
);
msg_Dbg
(
p_libvlc
,
"removing stats"
);
msg_Dbg
(
p_libvlc
,
"removing stats"
);
vlc_mutex_destroy
(
&
p_libvlc
->
p_stats
->
lock
);
FREENULL
(
p_libvlc
->
p_stats
);
#ifndef WIN32
#ifndef WIN32
char
*
psz_pidfile
=
NULL
;
char
*
psz_pidfile
=
NULL
;
...
...
src/libvlc.h
View file @
3d729748
...
@@ -217,9 +217,6 @@ typedef struct libvlc_priv_t
...
@@ -217,9 +217,6 @@ typedef struct libvlc_priv_t
int
i_timers
;
///< Number of timers
int
i_timers
;
///< Number of timers
bool
b_stats
;
///< Whether to collect stats
bool
b_stats
;
///< Whether to collect stats
void
*
p_stats_computer
;
///< Input thread computing stats
/// (needs cleanup)
/* Singleton objects */
/* Singleton objects */
module_t
*
p_memcpy_module
;
///< Fast memcpy plugin used
module_t
*
p_memcpy_module
;
///< Fast memcpy plugin used
playlist_t
*
p_playlist
;
//< the playlist singleton
playlist_t
*
p_playlist
;
//< the playlist singleton
...
...
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