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
153d58d2
Commit
153d58d2
authored
Jan 26, 2016
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vout: use unsigned stats
Inaccurate statistics are a lesser evil than undefined overflows.
parent
eb5e41d9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
11 deletions
+14
-11
src/input/decoder.c
src/input/decoder.c
+7
-8
src/video_output/statistic.h
src/video_output/statistic.h
+3
-1
src/video_output/video_output.c
src/video_output/video_output.c
+2
-1
src/video_output/vout_control.h
src/video_output/vout_control.h
+2
-1
No files found.
src/input/decoder.c
View file @
153d58d2
...
@@ -828,7 +828,7 @@ static void DecoderGetCc( decoder_t *p_dec, decoder_t *p_dec_cc )
...
@@ -828,7 +828,7 @@ static void DecoderGetCc( decoder_t *p_dec, decoder_t *p_dec_cc )
}
}
static
int
DecoderPlayVideo
(
decoder_t
*
p_dec
,
picture_t
*
p_picture
,
static
int
DecoderPlayVideo
(
decoder_t
*
p_dec
,
picture_t
*
p_picture
,
int
*
pi_lost_sum
)
unsigned
*
restrict
pi_lost_sum
)
{
{
decoder_owner_sys_t
*
p_owner
=
p_dec
->
p_owner
;
decoder_owner_sys_t
*
p_owner
=
p_dec
->
p_owner
;
vout_thread_t
*
p_vout
=
p_owner
->
p_vout
;
vout_thread_t
*
p_vout
=
p_owner
->
p_vout
;
...
@@ -926,12 +926,12 @@ static int DecoderPlayVideo( decoder_t *p_dec, picture_t *p_picture,
...
@@ -926,12 +926,12 @@ static int DecoderPlayVideo( decoder_t *p_dec, picture_t *p_picture,
return
0
;
return
0
;
}
}
static
void
DecoderUpdateStatVideo
(
decoder_t
*
p_dec
,
int
decoded
,
static
void
DecoderUpdateStatVideo
(
decoder_t
*
p_dec
,
unsigned
decoded
,
int
lost
)
unsigned
lost
)
{
{
decoder_owner_sys_t
*
p_owner
=
p_dec
->
p_owner
;
decoder_owner_sys_t
*
p_owner
=
p_dec
->
p_owner
;
input_thread_t
*
p_input
=
p_owner
->
p_input
;
input_thread_t
*
p_input
=
p_owner
->
p_input
;
int
displayed
=
0
;
unsigned
displayed
=
0
;
/* Update ugly stat */
/* Update ugly stat */
if
(
p_input
==
NULL
)
if
(
p_input
==
NULL
)
...
@@ -939,7 +939,7 @@ static void DecoderUpdateStatVideo( decoder_t *p_dec, int decoded,
...
@@ -939,7 +939,7 @@ static void DecoderUpdateStatVideo( decoder_t *p_dec, int decoded,
if
(
p_owner
->
p_vout
!=
NULL
)
if
(
p_owner
->
p_vout
!=
NULL
)
{
{
int
vout_lost
=
0
;
unsigned
vout_lost
=
0
;
vout_GetResetStatistic
(
p_owner
->
p_vout
,
&
displayed
,
&
vout_lost
);
vout_GetResetStatistic
(
p_owner
->
p_vout
,
&
displayed
,
&
vout_lost
);
lost
+=
vout_lost
;
lost
+=
vout_lost
;
...
@@ -955,7 +955,7 @@ static void DecoderUpdateStatVideo( decoder_t *p_dec, int decoded,
...
@@ -955,7 +955,7 @@ static void DecoderUpdateStatVideo( decoder_t *p_dec, int decoded,
static
int
DecoderQueueVideo
(
decoder_t
*
p_dec
,
picture_t
*
p_pic
)
static
int
DecoderQueueVideo
(
decoder_t
*
p_dec
,
picture_t
*
p_pic
)
{
{
assert
(
p_pic
);
assert
(
p_pic
);
int
i_lost
=
0
;
unsigned
i_lost
=
0
;
int
ret
=
DecoderPlayVideo
(
p_dec
,
p_pic
,
&
i_lost
);
int
ret
=
DecoderPlayVideo
(
p_dec
,
p_pic
,
&
i_lost
);
...
@@ -967,8 +967,7 @@ static void DecoderDecodeVideo( decoder_t *p_dec, block_t *p_block )
...
@@ -967,8 +967,7 @@ static void DecoderDecodeVideo( decoder_t *p_dec, block_t *p_block )
{
{
picture_t
*
p_pic
;
picture_t
*
p_pic
;
block_t
**
pp_block
=
p_block
?
&
p_block
:
NULL
;
block_t
**
pp_block
=
p_block
?
&
p_block
:
NULL
;
int
i_lost
=
0
;
unsigned
i_lost
=
0
,
i_decoded
=
0
;
int
i_decoded
=
0
;
while
(
(
p_pic
=
p_dec
->
pf_decode_video
(
p_dec
,
pp_block
)
)
)
while
(
(
p_pic
=
p_dec
->
pf_decode_video
(
p_dec
,
pp_block
)
)
)
{
{
...
...
src/video_output/statistic.h
View file @
153d58d2
...
@@ -44,7 +44,9 @@ static inline void vout_statistic_Clean(vout_statistic_t *stat)
...
@@ -44,7 +44,9 @@ static inline void vout_statistic_Clean(vout_statistic_t *stat)
(
void
)
stat
;
(
void
)
stat
;
}
}
static
inline
void
vout_statistic_GetReset
(
vout_statistic_t
*
stat
,
int
*
displayed
,
int
*
lost
)
static
inline
void
vout_statistic_GetReset
(
vout_statistic_t
*
stat
,
unsigned
*
restrict
displayed
,
unsigned
*
restrict
lost
)
{
{
*
displayed
=
atomic_exchange
(
&
stat
->
displayed
,
0
);
*
displayed
=
atomic_exchange
(
&
stat
->
displayed
,
0
);
*
lost
=
atomic_exchange
(
&
stat
->
lost
,
0
);
*
lost
=
atomic_exchange
(
&
stat
->
lost
,
0
);
...
...
src/video_output/video_output.c
View file @
153d58d2
...
@@ -320,7 +320,8 @@ void vout_ChangePause(vout_thread_t *vout, bool is_paused, mtime_t date)
...
@@ -320,7 +320,8 @@ void vout_ChangePause(vout_thread_t *vout, bool is_paused, mtime_t date)
vout_control_WaitEmpty
(
&
vout
->
p
->
control
);
vout_control_WaitEmpty
(
&
vout
->
p
->
control
);
}
}
void
vout_GetResetStatistic
(
vout_thread_t
*
vout
,
int
*
displayed
,
int
*
lost
)
void
vout_GetResetStatistic
(
vout_thread_t
*
vout
,
unsigned
*
restrict
displayed
,
unsigned
*
restrict
lost
)
{
{
vout_statistic_GetReset
(
&
vout
->
p
->
statistic
,
displayed
,
lost
);
vout_statistic_GetReset
(
&
vout
->
p
->
statistic
,
displayed
,
lost
);
}
}
...
...
src/video_output/vout_control.h
View file @
153d58d2
...
@@ -39,7 +39,8 @@ void spu_OffsetSubtitleDate( spu_t *p_spu, mtime_t i_duration );
...
@@ -39,7 +39,8 @@ void spu_OffsetSubtitleDate( spu_t *p_spu, mtime_t i_duration );
/**
/**
* This function will return and reset internal statistics.
* This function will return and reset internal statistics.
*/
*/
void
vout_GetResetStatistic
(
vout_thread_t
*
p_vout
,
int
*
pi_displayed
,
int
*
pi_lost
);
void
vout_GetResetStatistic
(
vout_thread_t
*
p_vout
,
unsigned
*
pi_displayed
,
unsigned
*
pi_lost
);
/**
/**
* This function will ensure that all ready/displayed pciture have at most
* This function will ensure that all ready/displayed pciture have at most
...
...
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