Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
dvb: add MHz to display mux name, fixes #2466
  • Loading branch information
perexg committed Nov 11, 2014
1 parent 6c6c69d commit e0f8ee4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/input/mpegts/mpegts_mux_dvb.c
Expand Up @@ -575,21 +575,23 @@ dvb_mux_display_name ( mpegts_mux_t *mm, char *buf, size_t len )
dvb_mux_t *lm = (dvb_mux_t*)mm;
dvb_network_t *ln = (dvb_network_t*)mm->mm_network;
uint32_t freq = lm->lm_tuning.dmc_fe_freq, freq2;
char pol[2] = { 0 };
char extra[8];
if (ln->ln_type == DVB_TYPE_S) {
const char *s = dvb_pol2str(lm->lm_tuning.u.dmc_fe_qpsk.polarisation);
if (s) pol[0] = *s;
if (s) extra[0] = *s;
extra[1] = '\0';
} else {
freq /= 1000;
strcpy(extra, "MHz");
}
freq2 = freq % 1000;
freq /= 1000;
while (freq2 && (freq2 % 10) == 0)
freq2 /= 10;
if (freq2)
snprintf(buf, len, "%d.%d%s", freq, freq2, pol);
snprintf(buf, len, "%d.%d%s", freq, freq2, extra);
else
snprintf(buf, len, "%d%s", freq, pol);
snprintf(buf, len, "%d%s", freq, extra);
}

static void
Expand Down

0 comments on commit e0f8ee4

Please sign in to comment.