Commit e17d5ecd authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Use KiB instead of kB for input statistics

This is an arbitrary choice. But KiB are much more common than kB.
Also the notation is unambiguous.

Note that we keep kbps for *bit* rates.
parent 2d692952
......@@ -1868,12 +1868,12 @@ static int updateStatistics( intf_thread_t *p_intf, input_item_t *p_item )
/* Input */
msg_rc("%s", _("+-[Incoming]"));
msg_rc(_("| input bytes read : %8.0f kB"),
(float)(p_item->p_stats->i_read_bytes)/1000 );
msg_rc(_("| input bytes read : %8.0f KiB"),
(float)(p_item->p_stats->i_read_bytes)/1024 );
msg_rc(_("| input bitrate : %6.0f kb/s"),
(float)(p_item->p_stats->f_input_bitrate)*8000 );
msg_rc(_("| demux bytes read : %8.0f kB"),
(float)(p_item->p_stats->i_demux_read_bytes)/1000 );
msg_rc(_("| demux bytes read : %8.0f KiB"),
(float)(p_item->p_stats->i_demux_read_bytes)/1024 );
msg_rc(_("| demux bitrate : %6.0f kb/s"),
(float)(p_item->p_stats->f_demux_bitrate)*8000 );
msg_rc(_("| demux corrupted : %5i"),
......@@ -1902,8 +1902,8 @@ static int updateStatistics( intf_thread_t *p_intf, input_item_t *p_item )
/* Sout */
msg_rc("%s", _("+-[Streaming]"));
msg_rc(_("| packets sent : %5i"), p_item->p_stats->i_sent_packets );
msg_rc(_("| bytes sent : %8.0f kB"),
(float)(p_item->p_stats->i_sent_bytes)/1000 );
msg_rc(_("| bytes sent : %8.0f KiB"),
(float)(p_item->p_stats->i_sent_bytes)/1024 );
msg_rc(_("| sending bitrate : %6.0f kb/s"),
(float)(p_item->p_stats->f_send_bitrate*8)*1000 );
msg_rc("|");
......
......@@ -195,9 +195,9 @@ static VLCInfo *_o_sharedInstance = nil;
- (void)initMediaPanelStats
{
//Initializing Input Variables
[o_read_bytes_txt setStringValue: [NSString stringWithFormat:@"%8.0f kB", (float)0]];
[o_read_bytes_txt setStringValue: [NSString stringWithFormat:@"%8.0f KiB", (float)0]];
[o_input_bitrate_txt setStringValue: [NSString stringWithFormat:@"%6.0f kb/s", (float)0]];
[o_demux_bytes_txt setStringValue: [NSString stringWithFormat:@"%8.0f kB", (float)0]];
[o_demux_bytes_txt setStringValue: [NSString stringWithFormat:@"%8.0f KiB", (float)0]];
[o_demux_bitrate_txt setStringValue: [NSString stringWithFormat:@"%6.0f kb/s", (float)0]];
//Initializing Video Variables
......@@ -208,7 +208,7 @@ static VLCInfo *_o_sharedInstance = nil;
//Initializing Output Variables
[o_sent_packets_txt setIntValue: 0];
[o_sent_bytes_txt setStringValue: [NSString stringWithFormat:@"%8.0f kB", (float)0]];
[o_sent_bytes_txt setStringValue: [NSString stringWithFormat:@"%8.0f KiB", (float)0]];
[o_sent_bitrate_txt setStringValue: [NSString stringWithFormat:@"%6.0f kb/s", (float)0]];
//Initializing Audio Variables
......@@ -328,11 +328,11 @@ static VLCInfo *_o_sharedInstance = nil;
/* input */
[o_read_bytes_txt setStringValue: [NSString stringWithFormat:
@"%8.0f kB", (float)(p_item->p_stats->i_read_bytes)/1000]];
@"%8.0f KiB", (float)(p_item->p_stats->i_read_bytes)/1024]];
[o_input_bitrate_txt setStringValue: [NSString stringWithFormat:
@"%6.0f kb/s", (float)(p_item->p_stats->f_input_bitrate)*8000]];
[o_demux_bytes_txt setStringValue: [NSString stringWithFormat:
@"%8.0f kB", (float)(p_item->p_stats->i_demux_read_bytes)/1000]];
@"%8.0f KiB", (float)(p_item->p_stats->i_demux_read_bytes)/1024]];
[o_demux_bitrate_txt setStringValue: [NSString stringWithFormat:
@"%6.0f kb/s", (float)(p_item->p_stats->f_demux_bitrate)*8000]];
......@@ -346,8 +346,8 @@ static VLCInfo *_o_sharedInstance = nil;
/* Sout */
[o_sent_packets_txt setIntValue: p_item->p_stats->i_sent_packets];
[o_sent_bytes_txt setStringValue: [NSString stringWithFormat: @"%8.0f kB",
(float)(p_item->p_stats->i_sent_bytes)/1000]];
[o_sent_bytes_txt setStringValue: [NSString stringWithFormat: @"%8.0f KiB",
(float)(p_item->p_stats->i_sent_bytes)/1024]];
[o_sent_bitrate_txt setStringValue: [NSString stringWithFormat:
@"%6.0f kb/s", (float)(p_item->p_stats->f_send_bitrate*8)*1000]];
......
......@@ -1972,13 +1972,13 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
MainBoxWrite( p_intf, l, 1, _("+-[Incoming]"));
SHOW_ACS( 1, ACS_ULCORNER ); SHOW_ACS( 2, ACS_HLINE ); l++;
if( p_sys->b_color ) wcolor_set( p_sys->w, C_DEFAULT, NULL );
MainBoxWrite( p_intf, l, 1, _("| input bytes read : %8.0f kB"),
(float)(p_item->p_stats->i_read_bytes)/1000 );
MainBoxWrite( p_intf, l, 1, _("| input bytes read : %8.0f KiB"),
(float)(p_item->p_stats->i_read_bytes)/1024 );
SHOW_ACS( 1, ACS_VLINE ); l++;
MainBoxWrite( p_intf, l, 1, _("| input bitrate : %6.0f kb/s"),
(float)(p_item->p_stats->f_input_bitrate)*8000 );
MainBoxWrite( p_intf, l, 1, _("| demux bytes read : %8.0f kB"),
(float)(p_item->p_stats->i_demux_read_bytes)/1000 );
MainBoxWrite( p_intf, l, 1, _("| demux bytes read : %8.0f KiB"),
(float)(p_item->p_stats->i_demux_read_bytes)/1024 );
SHOW_ACS( 1, ACS_VLINE ); l++;
MainBoxWrite( p_intf, l, 1, _("| demux bitrate : %6.0f kb/s"),
(float)(p_item->p_stats->f_demux_bitrate)*8000 );
......@@ -2031,8 +2031,8 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
if( p_sys->b_color ) wcolor_set( p_sys->w, C_DEFAULT, NULL );
MainBoxWrite( p_intf, l, 1, _("| packets sent : %5i"), p_item->p_stats->i_sent_packets );
SHOW_ACS( 1, ACS_VLINE ); l++;
MainBoxWrite( p_intf, l, 1, _("| bytes sent : %8.0f kB"),
(float)(p_item->p_stats->i_sent_bytes)/1000 );
MainBoxWrite( p_intf, l, 1, _("| bytes sent : %8.0f KiB"),
(float)(p_item->p_stats->i_sent_bytes)/1024 );
SHOW_ACS( 1, ACS_VLINE ); l++;
MainBoxWrite( p_intf, l, 1, _("\\ sending bitrate : %6.0f kb/s"),
(float)(p_item->p_stats->f_send_bitrate*8)*1000 );
......
......@@ -510,10 +510,10 @@ InputStatsPanel::InputStatsPanel( QWidget *parent,
CREATE_CATEGORY( streaming, qtr("Output/Written/Sent") );
CREATE_AND_ADD_TO_CAT( read_media_stat, qtr("Media data size"),
"0", input , "kB" );
"0", input , "KiB" );
CREATE_AND_ADD_TO_CAT( input_bitrate_stat, qtr("Input bitrate"),
"0", input, "kb/s" );
CREATE_AND_ADD_TO_CAT( demuxed_stat, qtr("Demuxed data size"), "0", input, "kB") ;
CREATE_AND_ADD_TO_CAT( demuxed_stat, qtr("Demuxed data size"), "0", input, "KiB") ;
CREATE_AND_ADD_TO_CAT( stream_bitrate_stat, qtr("Content bitrate"),
"0", input, "kb/s" );
CREATE_AND_ADD_TO_CAT( corrupted_stat, qtr("Discarded (corrupted)"),
......@@ -530,7 +530,7 @@ InputStatsPanel::InputStatsPanel( QWidget *parent,
CREATE_AND_ADD_TO_CAT( send_stat, qtr("Sent"), "0", streaming, qtr("packets") );
CREATE_AND_ADD_TO_CAT( send_bytes_stat, qtr("Sent"),
"0", streaming, "kB" );
"0", streaming, "KiB" );
CREATE_AND_ADD_TO_CAT( send_bitrate_stat, qtr("Upstream rate"),
"0", streaming, "kb/s" );
......@@ -567,11 +567,11 @@ void InputStatsPanel::update( input_item_t *p_item )
{ QString str; widget->setText( 1 , str.sprintf( format, ## calc ) ); }
UPDATE( read_media_stat, "%8.0f",
(float)(p_item->p_stats->i_read_bytes)/1000);
(float)(p_item->p_stats->i_read_bytes)/1024);
UPDATE( input_bitrate_stat, "%6.0f",
(float)(p_item->p_stats->f_input_bitrate * 8000 ));
UPDATE( demuxed_stat, "%8.0f",
(float)(p_item->p_stats->i_demux_read_bytes)/1000 );
(float)(p_item->p_stats->i_demux_read_bytes)/1024 );
UPDATE( stream_bitrate_stat, "%6.0f",
(float)(p_item->p_stats->f_demux_bitrate * 8000 ));
UPDATE( corrupted_stat, "%5i", p_item->p_stats->i_demux_corrupted );
......@@ -585,7 +585,7 @@ void InputStatsPanel::update( input_item_t *p_item )
/* Sout */
UPDATE( send_stat, "%5i", p_item->p_stats->i_sent_packets );
UPDATE( send_bytes_stat, "%8.0f",
(float)(p_item->p_stats->i_sent_bytes)/1000 );
(float)(p_item->p_stats->i_sent_bytes)/1024 );
UPDATE( send_bitrate_stat, "%6.0f",
(float)(p_item->p_stats->f_send_bitrate*8)*1000 );
......
......@@ -332,9 +332,9 @@ function stats(name,client)
client:append("+----[ begin of statistical info")
client:append("+-[Incoming]")
client:append("| input bytes read : "..string.format("%8.0f kB",stats_tab["read_bytes"]/1000))
client:append("| input bitrate : "..string.format("%6.0f bB/s",stats_tab["input_bitrate"]*8000))
client:append("| demux bytes read : "..string.format("%8.0f kB",stats_tab["demux_read_bytes"]/1000))
client:append("| input bytes read : "..string.format("%8.0f KiB",stats_tab["read_bytes"]/1024))
client:append("| input bitrate : "..string.format("%6.0f kB/s",stats_tab["input_bitrate"]*8000))
client:append("| demux bytes read : "..string.format("%8.0f KiB",stats_tab["demux_read_bytes"]/1024))
client:append("| demux bitrate : "..string.format("%6.0f kB/s",stats_tab["demux_bitrate"]*8000))
client:append("| demux corrupted : "..string.format("%5i",stats_tab["demux_corrupted"]))
client:append("| discontinuities : "..string.format("%5i",stats_tab["demux_discontinuity"]))
......@@ -351,7 +351,7 @@ function stats(name,client)
client:append("|")
client:append("+-[Streaming]")
client:append("| packets sent : "..string.format("%5i",stats_tab["sent_packets"]))
client:append("| bytes sent : "..string.format("%8.0f kB",stats_tab["sent_bytes"]/1000))
client:append("| bytes sent : "..string.format("%8.0f KiB",stats_tab["sent_bytes"]/1024))
client:append("| sending bitrate : "..string.format("%6.0f kb/s",stats_tab["send_bitrate"]*8000))
client:append("+----[ end of statistical info ]")
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment