Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
sat>ip: fixes for snr and signal strength calculation (contributed by…
… stan86).
  • Loading branch information
ksooo authored and perexg committed Aug 1, 2014
1 parent 1858323 commit cbffd47
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/input/mpegts/satip/satip_frontend.c
Expand Up @@ -712,19 +712,19 @@ satip_frontend_decode_rtcp( satip_frontend_t *lfe, const char *name,
if (atoi(argv[0]) != lfe->sf_number)
return;
mmi->mmi_stats.signal =
((atoi(argv[1]) * 100) / lfe->sf_device->sd_sig_scale) * 65535 / 100;
atoi(argv[1]) * 0xffff / lfe->sf_device->sd_sig_scale;
mmi->mmi_stats.signal_scale =
INPUT_STREAM_STATS_SCALE_RELATIVE;
if (atoi(argv[2]) > 0)
status = SIGNAL_GOOD;
mmi->mmi_stats.snr = atoi(argv[3]) * 65535 / 100;
mmi->mmi_stats.snr = atoi(argv[3]) * 0xffff / 15;
mmi->mmi_stats.snr_scale =
INPUT_STREAM_STATS_SCALE_RELATIVE;
if (status == SIGNAL_GOOD &&
mmi->mmi_stats.signal == 0 && mmi->mmi_stats.snr == 0) {
/* some values that we're tuned */
mmi->mmi_stats.signal = 50 * 65535 / 100;
mmi->mmi_stats.snr = 12 * 65535 / 100;
mmi->mmi_stats.signal = 50 * 0xffff / 100;
mmi->mmi_stats.snr = 12 * 0xffff / 15;
}
goto ok;
} else if (strncmp(s, "ver=1.0;", 8) == 0) {
Expand All @@ -737,12 +737,12 @@ satip_frontend_decode_rtcp( satip_frontend_t *lfe, const char *name,
if (atoi(argv[0]) != lfe->sf_number)
return;
mmi->mmi_stats.signal =
((atoi(argv[1]) * 100) / lfe->sf_device->sd_sig_scale) * 65535 / 100;
atoi(argv[1]) * 0xffff / lfe->sf_device->sd_sig_scale;
mmi->mmi_stats.signal_scale =
INPUT_STREAM_STATS_SCALE_RELATIVE;
if (atoi(argv[2]) > 0)
status = SIGNAL_GOOD;
mmi->mmi_stats.snr = atoi(argv[3]) * 65535 / 100;
mmi->mmi_stats.snr = atoi(argv[3]) * 0xffff / 15;
mmi->mmi_stats.snr_scale =
INPUT_STREAM_STATS_SCALE_RELATIVE;
goto ok;
Expand All @@ -753,12 +753,12 @@ satip_frontend_decode_rtcp( satip_frontend_t *lfe, const char *name,
if (atoi(argv[0]) != lfe->sf_number)
return;
mmi->mmi_stats.signal =
((atoi(argv[1]) * 100) / lfe->sf_device->sd_sig_scale) * 65535 / 100;
atoi(argv[1]) * 0xffff / lfe->sf_device->sd_sig_scale;
mmi->mmi_stats.signal_scale =
INPUT_STREAM_STATS_SCALE_RELATIVE;
if (atoi(argv[2]) > 0)
status = SIGNAL_GOOD;
mmi->mmi_stats.snr = atoi(argv[3]) * 65535 / 100;
mmi->mmi_stats.snr = atoi(argv[3]) * 0xffff / 15;
mmi->mmi_stats.snr_scale =
INPUT_STREAM_STATS_SCALE_RELATIVE;
goto ok;
Expand Down

0 comments on commit cbffd47

Please sign in to comment.