Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
4efb2911
Commit
4efb2911
authored
Feb 04, 2006
by
zorglub
Browse files
AccessOutWrite is called very often, especially for TS. Don't store stats on each call
parent
8d995e6f
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/stream_output.h
View file @
4efb2911
...
...
@@ -106,6 +106,10 @@ struct sout_access_out_t
char
*
psz_access
;
sout_cfg_t
*
p_cfg
;
int
i_writes
;
int64_t
i_sent_bytes
;
///< This is a "local" counter that is reset each
// time it is transferred to stats
char
*
psz_name
;
sout_access_out_sys_t
*
p_sys
;
int
(
*
pf_seek
)(
sout_access_out_t
*
,
off_t
);
...
...
src/stream_output/stream_output.c
View file @
4efb2911
...
...
@@ -309,6 +309,10 @@ sout_access_out_t *sout_AccessOutNew( sout_instance_t *p_sout,
p_access
->
pf_read
=
NULL
;
p_access
->
pf_write
=
NULL
;
p_access
->
p_module
=
NULL
;
p_access
->
i_writes
=
0
;
p_access
->
i_sent_bytes
=
0
;
vlc_object_attach
(
p_access
,
p_sout
);
p_access
->
p_module
=
...
...
@@ -367,21 +371,25 @@ int sout_AccessOutRead( sout_access_out_t *p_access, block_t *p_buffer )
int
sout_AccessOutWrite
(
sout_access_out_t
*
p_access
,
block_t
*
p_buffer
)
{
int
i_total
;
if
(
p_access
->
p_libvlc
->
b_stats
)
p_access
->
i_writes
++
;
p_access
->
i_sent_bytes
+=
p_buffer
->
i_buffer
;
if
(
p_access
->
p_libvlc
->
b_stats
&&
p_access
->
i_writes
%
10
==
0
)
{
/* Access_out -> sout_instance -> input_thread_t */
input_thread_t
*
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
p_access
,
VLC_OBJECT_INPUT
,
input_thread_t
*
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
p_access
,
VLC_OBJECT_INPUT
,
FIND_PARENT
);
if
(
p_input
)
{
stats_UpdateInteger
(
p_input
,
"sout_sent_packets"
,
1
);
stats_UpdateInteger
(
p_input
,
"sout_sent_bytes"
,
p_
buffer
->
i_buffer
);
stats_GetInteger
(
p_input
,
stats_UpdateInteger
(
p_input
,
"sout_sent_packets"
,
1
0
);
stats_UpdateInteger
(
p_input
,
"sout_sent_bytes"
,
p_
access
->
i_sent_bytes
);
stats_GetInteger
(
p_input
,
p_access
->
p_parent
->
p_parent
->
i_object_id
,
"sout_sent_bytes"
,
&
i_total
);
stats_UpdateFloat
(
p_input
,
"sout_send_bitrate"
,
(
float
)
i_total
);
p_access
->
i_sent_bytes
=
0
;
vlc_object_release
(
p_input
);
}
}
...
...
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