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
eb5e41d9
Commit
eb5e41d9
authored
Jan 26, 2016
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder: only fetch vout stats if used
parent
d12d90d0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
21 deletions
+22
-21
src/input/decoder.c
src/input/decoder.c
+22
-21
No files found.
src/input/decoder.c
View file @
eb5e41d9
...
...
@@ -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
,
int
*
pi_
played_sum
,
int
*
pi_
lost_sum
)
int
*
pi_lost_sum
)
{
decoder_owner_sys_t
*
p_owner
=
p_dec
->
p_owner
;
vout_thread_t
*
p_vout
=
p_owner
->
p_vout
;
...
...
@@ -922,42 +922,44 @@ static int DecoderPlayVideo( decoder_t *p_dec, picture_t *p_picture,
*
pi_lost_sum
+=
1
;
picture_Release
(
p_picture
);
}
int
i_tmp_display
;
int
i_tmp_lost
;
vout_GetResetStatistic
(
p_vout
,
&
i_tmp_display
,
&
i_tmp_lost
);
*
pi_played_sum
+=
i_tmp_display
;
*
pi_lost_sum
+=
i_tmp_lost
;
return
0
;
}
static
void
DecoderUpdateStatVideo
(
decoder_t
*
p_dec
,
int
i_
decoded
,
int
i_lost
,
int
i_displayed
)
static
void
DecoderUpdateStatVideo
(
decoder_t
*
p_dec
,
int
decoded
,
int
lost
)
{
decoder_owner_sys_t
*
p_owner
=
p_dec
->
p_owner
;
input_thread_t
*
p_input
=
p_owner
->
p_input
;
int
displayed
=
0
;
/* Update ugly stat */
if
(
p_input
!=
NULL
&&
(
i_decoded
>
0
||
i_lost
>
0
||
i_displayed
>
0
)
)
if
(
p_input
==
NULL
)
return
;
if
(
p_owner
->
p_vout
!=
NULL
)
{
int
vout_lost
=
0
;
vout_GetResetStatistic
(
p_owner
->
p_vout
,
&
displayed
,
&
vout_lost
);
lost
+=
vout_lost
;
}
vlc_mutex_lock
(
&
p_input
->
p
->
counters
.
counters_lock
);
stats_Update
(
p_input
->
p
->
counters
.
p_decoded_video
,
i_decoded
,
NULL
);
stats_Update
(
p_input
->
p
->
counters
.
p_lost_pictures
,
i_lost
,
NULL
);
stats_Update
(
p_input
->
p
->
counters
.
p_displayed_pictures
,
i_displayed
,
NULL
);
stats_Update
(
p_input
->
p
->
counters
.
p_decoded_video
,
decoded
,
NULL
);
stats_Update
(
p_input
->
p
->
counters
.
p_lost_pictures
,
lost
,
NULL
);
stats_Update
(
p_input
->
p
->
counters
.
p_displayed_pictures
,
displayed
,
NULL
);
vlc_mutex_unlock
(
&
p_input
->
p
->
counters
.
counters_lock
);
}
}
static
int
DecoderQueueVideo
(
decoder_t
*
p_dec
,
picture_t
*
p_pic
)
{
assert
(
p_pic
);
int
i_lost
=
0
;
int
i_displayed
=
0
;
int
ret
=
DecoderPlayVideo
(
p_dec
,
p_pic
,
&
i_
displayed
,
&
i_
lost
);
int
ret
=
DecoderPlayVideo
(
p_dec
,
p_pic
,
&
i_lost
);
DecoderUpdateStatVideo
(
p_dec
,
1
,
i_lost
,
i_displayed
);
DecoderUpdateStatVideo
(
p_dec
,
1
,
i_lost
);
return
ret
;
}
...
...
@@ -967,16 +969,15 @@ static void DecoderDecodeVideo( decoder_t *p_dec, block_t *p_block )
block_t
**
pp_block
=
p_block
?
&
p_block
:
NULL
;
int
i_lost
=
0
;
int
i_decoded
=
0
;
int
i_displayed
=
0
;
while
(
(
p_pic
=
p_dec
->
pf_decode_video
(
p_dec
,
pp_block
)
)
)
{
i_decoded
++
;
DecoderPlayVideo
(
p_dec
,
p_pic
,
&
i_
displayed
,
&
i_
lost
);
DecoderPlayVideo
(
p_dec
,
p_pic
,
&
i_lost
);
}
DecoderUpdateStatVideo
(
p_dec
,
i_decoded
,
i_lost
,
i_displayed
);
DecoderUpdateStatVideo
(
p_dec
,
i_decoded
,
i_lost
);
}
/* This function process a video block
...
...
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