From: beralt Date: Mon, 25 Nov 2013 10:59:16 +0000 (+0100) Subject: linuxdvb: convert snr units to dB X-Git-Tag: v4.1~2346^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F307%2Fhead;p=thirdparty%2Ftvheadend.git linuxdvb: convert snr units to dB --- diff --git a/src/input/mpegts/linuxdvb/linuxdvb_frontend.c b/src/input/mpegts/linuxdvb/linuxdvb_frontend.c index f49c98891..0e3aef10f 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_frontend.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_frontend.c @@ -568,10 +568,9 @@ linuxdvb_frontend_monitor ( void *aux ) } } if(fe_properties[3].u.st.len > 0) { - /* note that decibel scale means 0.0001 dB units */ - /* TODO: snr is not unsigned, but signed! */ + /* note that decibel scale means 1 = 0.0001 dB units here */ if(fe_properties[3].u.st.stat[0].scale == FE_SCALE_DECIBEL) - mmi->mmi_stats.snr = fe_properties[3].u.st.stat[0].uvalue; + mmi->mmi_stats.snr = fe_properties[3].u.st.stat[0].svalue * 0.0001; /* TODO: handle other scales */ } /* Calculate PER from PRE_ERROR and TOTAL_BIT_COUNT */