From: beralt Date: Mon, 25 Nov 2013 10:27:13 +0000 (+0100) Subject: linuxdvb: fix small errors while gathering statistics X-Git-Tag: v4.1~2346^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=124039f1aee324c183b59ccba13d412e5d30d76f;p=thirdparty%2Ftvheadend.git linuxdvb: fix small errors while gathering statistics --- diff --git a/src/input/mpegts/linuxdvb/linuxdvb_frontend.c b/src/input/mpegts/linuxdvb/linuxdvb_frontend.c index dc0c64463..91f43f0ce 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_frontend.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_frontend.c @@ -560,8 +560,12 @@ linuxdvb_frontend_monitor ( void *aux ) u16 = fe_properties[1].u.st.stat[0].uvalue; } if(fe_properties[2].u.st.len > 0) { - if(fe_properties[2].u.st.stat[0].scale == FE_SCALE_COUNTER) - mmi->mmi_stats.ber = u16 / fe_properties[2].u.st.stat[0].uvalue; + if(fe_properties[2].u.st.stat[0].scale == FE_SCALE_COUNTER) { + if(fe_properties[5].u.st.stat[0].uvalue > 0 ) + mmi->mmi_stats.ber = u16 / fe_properties[2].u.st.stat[0].uvalue; + else + mmi->mmi_stats.ber = 0; + } } if(fe_properties[3].u.st.len > 0) { /* note that decibel scale means 0.0001 dB units */ @@ -576,8 +580,12 @@ linuxdvb_frontend_monitor ( void *aux ) u16 = fe_properties[4].u.st.stat[0].uvalue; } if(fe_properties[5].u.st.len > 0) { - if(fe_properties[5].u.st.stat[0].scale == FE_SCALE_COUNTER) - mmi->mmi_stats.unc = u16 / fe_properties[5].u.st.stat[0].uvalue; + if(fe_properties[5].u.st.stat[0].scale == FE_SCALE_COUNTER) { + if(fe_properties[5].u.st.stat[0].uvalue > 0 ) + mmi->mmi_stats.unc = u16 / fe_properties[5].u.st.stat[0].uvalue; + else + mmi->mmi_stats.unc = 0; + } } } else { /* use old v3 API */