diff options
author | Mamadou DIOP <bossiel@yahoo.fr> | 2016-02-25 00:59:05 +0100 |
---|---|---|
committer | Mamadou DIOP <bossiel@yahoo.fr> | 2016-02-25 00:59:05 +0100 |
commit | c6a8fde4aaf6fd5185814525fcee3193fedef67d (patch) | |
tree | fe43c3c7dbc137c8d20db6b9ec4543457ad37fcb | |
parent | 3d46d2f68c23e39f6862d71854d5ebed495836b4 (diff) | |
download | doubango-c6a8fde4aaf6fd5185814525fcee3193fedef67d.zip doubango-c6a8fde4aaf6fd5185814525fcee3193fedef67d.tar.gz |
Do not reset quality metrics when the timer fires: continue averaging
-rwxr-xr-x | tinyDAV/src/video/tdav_session_video.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tinyDAV/src/video/tdav_session_video.c b/tinyDAV/src/video/tdav_session_video.c index c867605..403dfde 100755 --- a/tinyDAV/src/video/tdav_session_video.c +++ b/tinyDAV/src/video/tdav_session_video.c @@ -1439,13 +1439,16 @@ static int _tdav_session_video_timer_cb(const void* arg, tsk_timer_id_t timer_id session->qos_metrics.video_out_height = codec->out.height; session->qos_metrics.video_in_width = codec->in.width; session->qos_metrics.video_in_height = codec->in.height; - // reset n - video->q1_n = video->q2_n = video->q3_n = video->q4_n = video->q5_n = 0; - session->qos_metrics.q1 = session->qos_metrics.q2 = session->qos_metrics.q3 = session->qos_metrics.q4 = session->qos_metrics.q5 = 0.f; + // continue averaging - video->in_avg_fps_n = video->in_avg_fps_n ? 1 : 0; - video->dec_avg_time_n = video->dec_avg_time_n ? 1 : 0; - video->enc_avg_time_n = video->enc_avg_time_n ? 1 : 0; + video->q1_n = TSK_CLAMP(0, video->q1_n, 1); + video->q2_n = TSK_CLAMP(0, video->q2_n, 1); + video->q3_n = TSK_CLAMP(0, video->q3_n, 1); + video->q4_n = TSK_CLAMP(0, video->q4_n, 1); + video->q5_n = TSK_CLAMP(0, video->q5_n, 1); + video->in_avg_fps_n = TSK_CLAMP(0, video->in_avg_fps_n, 1); + video->dec_avg_time_n = TSK_CLAMP(0, video->dec_avg_time_n, 1); + video->enc_avg_time_n = TSK_CLAMP(0, video->enc_avg_time_n, 1); // reset time session->qos_metrics.last_update_time = tsk_time_now(); |