Commit 7f483827 authored by Ilkka Ollakka's avatar Ilkka Ollakka

statistics to 64bit

Didn't touch the os x interface code. I don't think I missed any core-code that relates.
Fixe #3411
parent ef39893f
......@@ -277,35 +277,35 @@ struct input_stats_t
vlc_mutex_t lock;
/* Input */
int i_read_packets;
int i_read_bytes;
int64_t i_read_packets;
int64_t i_read_bytes;
float f_input_bitrate;
float f_average_input_bitrate;
/* Demux */
int i_demux_read_packets;
int i_demux_read_bytes;
int64_t i_demux_read_packets;
int64_t i_demux_read_bytes;
float f_demux_bitrate;
float f_average_demux_bitrate;
int i_demux_corrupted;
int i_demux_discontinuity;
int64_t i_demux_corrupted;
int64_t i_demux_discontinuity;
/* Decoders */
int i_decoded_audio;
int i_decoded_video;
int64_t i_decoded_audio;
int64_t i_decoded_video;
/* Vout */
int i_displayed_pictures;
int i_lost_pictures;
int64_t i_displayed_pictures;
int64_t i_lost_pictures;
/* Sout */
int i_sent_packets;
int i_sent_bytes;
int64_t i_sent_packets;
int64_t i_sent_bytes;
float f_send_bitrate;
/* Aout */
int i_played_abuffers;
int i_lost_abuffers;
int64_t i_played_abuffers;
int64_t i_lost_abuffers;
};
#endif
......@@ -1995,13 +1995,13 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
MainBoxWrite( p_intf, l, 1, _("+-[Video Decoding]"));
SHOW_ACS( 1, ACS_LTEE ); SHOW_ACS( 2, ACS_HLINE ); l++;
if( p_sys->b_color ) wcolor_set( p_sys->w, C_DEFAULT, NULL );
MainBoxWrite( p_intf, l, 1, _("| video decoded : %5i"),
MainBoxWrite( p_intf, l, 1, _("| video decoded : %"PRId64),
p_item->p_stats->i_decoded_video );
SHOW_ACS( 1, ACS_VLINE ); l++;
MainBoxWrite( p_intf, l, 1, _("| frames displayed : %5i"),
MainBoxWrite( p_intf, l, 1, _("| frames displayed : %"PRId64),
p_item->p_stats->i_displayed_pictures );
SHOW_ACS( 1, ACS_VLINE ); l++;
MainBoxWrite( p_intf, l, 1, _("| frames lost : %5i"),
MainBoxWrite( p_intf, l, 1, _("| frames lost : %"PRId64),
p_item->p_stats->i_lost_pictures );
SHOW_ACS( 1, ACS_VLINE ); l++;
DrawEmptyLine( p_sys->w, p_sys->i_box_y + l - p_sys->i_box_start, 1, COLS - 2 );
......@@ -2014,13 +2014,13 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
MainBoxWrite( p_intf, l, 1, _("+-[Audio Decoding]"));
SHOW_ACS( 1, ACS_LTEE ); SHOW_ACS( 2, ACS_HLINE ); l++;
if( p_sys->b_color ) wcolor_set( p_sys->w, C_DEFAULT, NULL );
MainBoxWrite( p_intf, l, 1, _("| audio decoded : %5i"),
MainBoxWrite( p_intf, l, 1, _("| audio decoded : %"PRId64),
p_item->p_stats->i_decoded_audio );
SHOW_ACS( 1, ACS_VLINE ); l++;
MainBoxWrite( p_intf, l, 1, _("| buffers played : %5i"),
MainBoxWrite( p_intf, l, 1, _("| buffers played : %"PRId64),
p_item->p_stats->i_played_abuffers );
SHOW_ACS( 1, ACS_VLINE ); l++;
MainBoxWrite( p_intf, l, 1, _("| buffers lost : %5i"),
MainBoxWrite( p_intf, l, 1, _("| buffers lost : %"PRId64),
p_item->p_stats->i_lost_abuffers );
SHOW_ACS( 1, ACS_VLINE ); l++;
DrawEmptyLine( p_sys->w, p_sys->i_box_y + l - p_sys->i_box_start, 1, COLS - 2 );
......
......@@ -23,6 +23,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#define __STDC_FORMAT_MACROS 1
#define __STDC_CONSTANT_MACROS 1
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
......@@ -566,33 +569,33 @@ void InputStatsPanel::update( input_item_t *p_item )
#define UPDATE( widget, format, calc... ) \
{ QString str; widget->setText( 1 , str.sprintf( format, ## calc ) ); }
UPDATE( read_media_stat, "%8.0f",
(float)(p_item->p_stats->i_read_bytes)/1024);
UPDATE( read_media_stat, "%"PRId64,
(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)/1024 );
UPDATE( demuxed_stat, "%"PRId64,
(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 );
UPDATE( discontinuity_stat, "%5i", p_item->p_stats->i_demux_discontinuity );
UPDATE( corrupted_stat, "%"PRId64, p_item->p_stats->i_demux_corrupted );
UPDATE( discontinuity_stat, "%"PRId64, p_item->p_stats->i_demux_discontinuity );
/* Video */
UPDATE( vdecoded_stat, "%5i", p_item->p_stats->i_decoded_video );
UPDATE( vdisplayed_stat, "%5i", p_item->p_stats->i_displayed_pictures );
UPDATE( vlost_frames_stat, "%5i", p_item->p_stats->i_lost_pictures );
UPDATE( vdecoded_stat, "%"PRId64, p_item->p_stats->i_decoded_video );
UPDATE( vdisplayed_stat, "%"PRId64, p_item->p_stats->i_displayed_pictures );
UPDATE( vlost_frames_stat, "%"PRId64, p_item->p_stats->i_lost_pictures );
/* 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)/1024 );
UPDATE( send_stat, "%"PRId64, p_item->p_stats->i_sent_packets );
UPDATE( send_bytes_stat, "%"PRId64,
(p_item->p_stats->i_sent_bytes)/ 1024 );
UPDATE( send_bitrate_stat, "%6.0f",
(float)(p_item->p_stats->f_send_bitrate*8)*1000 );
(float)(p_item->p_stats->f_send_bitrate * 8000 ) );
/* Audio*/
UPDATE( adecoded_stat, "%5i", p_item->p_stats->i_decoded_audio );
UPDATE( aplayed_stat, "%5i", p_item->p_stats->i_played_abuffers );
UPDATE( alost_stat, "%5i", p_item->p_stats->i_lost_abuffers );
UPDATE( adecoded_stat, "%"PRId64, p_item->p_stats->i_decoded_audio );
UPDATE( aplayed_stat, "%"PRId64, p_item->p_stats->i_played_abuffers );
UPDATE( alost_stat, "%"PRId64, p_item->p_stats->i_lost_abuffers );
#undef UPDATE
......
......@@ -127,7 +127,7 @@ int stats_Get( vlc_object_t *p_this, counter_t *p_counter, vlc_value_t *val )
p_counter->pp_samples[1]->value.i_int ) /
(float)( p_counter->pp_samples[0]->date -
p_counter->pp_samples[1]->date );
val->i_int = (int)f;
val->i_int = (int64_t)f;
}
else
{
......@@ -232,9 +232,9 @@ void stats_DumpInputStats( input_stats_t *p_stats )
vlc_mutex_lock( &p_stats->lock );
/* f_bitrate is in bytes / microsecond
* *1000 => bytes / millisecond => kbytes / seconds */
fprintf( stderr, "Input : %i (%i bytes) - %f kB/s - "
"Demux : %i (%i bytes) - %f kB/s\n"
" - Vout : %i/%i - Aout : %i/%i - Sout : %f\n",
fprintf( stderr, "Input : %"PRId64" (%"PRId64" bytes) - %f kB/s - "
"Demux : %"PRId64" (%"PRId64" bytes) - %f kB/s\n"
" - Vout : %"PRId64"/%"PRId64" - Aout : %"PRId64"/%"PRId64" - Sout : %f\n",
p_stats->i_read_packets, p_stats->i_read_bytes,
p_stats->f_input_bitrate * 1000,
p_stats->i_demux_read_packets, p_stats->i_demux_read_bytes,
......@@ -560,7 +560,7 @@ static void TimerDump( vlc_object_t *p_obj, counter_t *p_counter,
return;
mtime_t last, total;
int i_total;
int64_t i_total;
if( p_counter->i_samples != 2 )
{
msg_Err( p_obj, "timer %s does not exist", p_counter->psz_name );
......@@ -581,14 +581,14 @@ static void TimerDump( vlc_object_t *p_obj, counter_t *p_counter,
if( b_total )
{
msg_Dbg( p_obj,
"TIMER %s : %.3f ms - Total %.3f ms / %i intvls (Avg %.3f ms)",
"TIMER %s : %.3f ms - Total %.3f ms / %"PRId64" intvls (Avg %.3f ms)",
p_counter->psz_name, (float)last/1000, (float)total/1000, i_total,
(float)(total)/(1000*(float)i_total ) );
}
else
{
msg_Dbg( p_obj,
"TIMER %s : Total %.3f ms / %i intvls (Avg %.3f ms)",
"TIMER %s : Total %.3f ms / %"PRId64" intvls (Avg %.3f ms)",
p_counter->psz_name, (float)total/1000, i_total,
(float)(total)/(1000*(float)i_total ) );
}
......
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