Fix incorrect video render stats, fix enable/disable stats key combo

This commit is contained in:
rock88 2020-05-15 19:24:22 +03:00
parent 7fb1564171
commit 776d42a69f
2 changed files with 5 additions and 4 deletions

View file

@ -154,7 +154,7 @@ void GLVideoRenderer::draw(int width, int height, AVFrame *frame) {
m_video_render_stats.measurement_start_timestamp = LiGetMillis(); m_video_render_stats.measurement_start_timestamp = LiGetMillis();
} }
uint32_t before_render = LiGetMillis(); uint64_t before_render = LiGetMillis();
if (!m_is_initialized) { if (!m_is_initialized) {
initialize(); initialize();

View file

@ -81,11 +81,12 @@ void StreamWindow::draw(NVGcontext *ctx) {
stats->video_render_stats.rendered_fps); stats->video_render_stats.rendered_fps);
offset += sprintf(&output[offset], offset += sprintf(&output[offset],
"Frames dropped by your network connection: %.2f%%\n" "Frames dropped by your network connection: %.2f%% (Total: %u)\n"
"Average receive time: %.2f ms\n" "Average receive time: %.2f ms\n"
"Average decoding time: %.2f ms\n" "Average decoding time: %.2f ms\n"
"Average rendering time: %.2f ms\n", "Average rendering time: %.2f ms\n",
(float)stats->video_decode_stats.network_dropped_frames / stats->video_decode_stats.total_frames * 100, (float)stats->video_decode_stats.network_dropped_frames / stats->video_decode_stats.total_frames * 100,
stats->video_decode_stats.network_dropped_frames,
(float)stats->video_decode_stats.total_reassembly_time / stats->video_decode_stats.received_frames, (float)stats->video_decode_stats.total_reassembly_time / stats->video_decode_stats.received_frames,
(float)stats->video_decode_stats.total_decode_time / stats->video_decode_stats.decoded_frames, (float)stats->video_decode_stats.total_decode_time / stats->video_decode_stats.decoded_frames,
(float)stats->video_render_stats.total_render_time / stats->video_render_stats.rendered_frames); (float)stats->video_render_stats.total_render_time / stats->video_render_stats.rendered_frames);
@ -106,7 +107,7 @@ void StreamWindow::draw(NVGcontext *ctx) {
if (!m_draw_stats && GAME_PAD_COMBO_R(LEFT_FLAG)) { if (!m_draw_stats && GAME_PAD_COMBO_R(LEFT_FLAG)) {
m_draw_stats = true; m_draw_stats = true;
} else if (m_draw_stats && GAME_PAD_COMBO_R(LEFT_FLAG)) { } else if (m_draw_stats && GAME_PAD_COMBO_R(RIGHT_FLAG)) {
m_draw_stats = false; m_draw_stats = false;
} }