mpegts: improve the mux display name
- show MHz values also for DVB-T and DVB-C - show also kHz digits after dot (up to 3)
This commit is contained in:
parent
c31a0c8077
commit
e5fda6dd79
1 changed files with 10 additions and 4 deletions
|
@ -574,16 +574,22 @@ 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;
|
||||
uint32_t freq = lm->lm_tuning.dmc_fe_freq, freq2;
|
||||
char pol[2] = { 0 };
|
||||
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;
|
||||
freq /= 1000;
|
||||
} else {
|
||||
freq /= 1000;
|
||||
}
|
||||
snprintf(buf, len, "%d%s", freq, pol);
|
||||
}
|
||||
freq2 = freq % 1000;
|
||||
freq /= 1000;
|
||||
while (freq2 && (freq2 % 10) == 0)
|
||||
freq2 /= 10;
|
||||
if (freq2)
|
||||
snprintf(buf, len, "%d.%d%s", freq, freq2, pol);
|
||||
else
|
||||
snprintf(buf, len, "%d%s", freq, pol);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Add table
Reference in a new issue