mpegts: some updates to display values
This commit is contained in:
parent
cc144adabf
commit
f6d579079c
2 changed files with 24 additions and 6 deletions
|
@ -397,16 +397,15 @@ linuxdvb_mux_display_name ( mpegts_mux_t *mm, char *buf, size_t len )
|
|||
{
|
||||
linuxdvb_mux_t *lm = (linuxdvb_mux_t*)mm;
|
||||
linuxdvb_network_t *ln = (linuxdvb_network_t*)mm->mm_network;
|
||||
int freq = lm->lm_tuning.dmc_fe_params.frequency;
|
||||
uint32_t freq = lm->lm_tuning.dmc_fe_params.frequency;
|
||||
char pol[2] = { 0 };
|
||||
if (ln->ln_type == FE_QPSK) {
|
||||
pol[0] = *(dvb_pol2str(lm->lm_tuning.dmc_fe_polarisation));
|
||||
freq /= 1000;
|
||||
} else {
|
||||
freq /= 1000;
|
||||
}
|
||||
snprintf(buf, len, "%d %s%s [onid:%04X, tsid:%04X]",
|
||||
freq,
|
||||
(ln->ln_type == FE_QPSK) ? "MHz " : "Hz",
|
||||
(ln->ln_type == FE_QPSK) ? pol : "",
|
||||
mm->mm_onid, mm->mm_tsid);
|
||||
snprintf(buf, len, "%d%s", freq, pol);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -132,6 +132,18 @@ mpegts_mux_class_get_network ( void *ptr )
|
|||
return &s;
|
||||
}
|
||||
|
||||
static const void *
|
||||
mpegts_mux_class_get_name ( void *ptr )
|
||||
{
|
||||
static char buf[512], *s = buf;
|
||||
mpegts_mux_t *mm = ptr;
|
||||
if (mm && mm->mm_display_name)
|
||||
mm->mm_display_name(mm, buf, sizeof(buf));
|
||||
else
|
||||
*buf = 0;
|
||||
return &s;
|
||||
}
|
||||
|
||||
const idclass_t mpegts_mux_class =
|
||||
{
|
||||
.ic_class = "mpegts_mux",
|
||||
|
@ -151,6 +163,13 @@ const idclass_t mpegts_mux_class =
|
|||
.opts = PO_RDONLY | PO_NOSAVE,
|
||||
.get = mpegts_mux_class_get_network,
|
||||
},
|
||||
{
|
||||
.type = PT_STR,
|
||||
.id = "name",
|
||||
.name = "Name",
|
||||
.opts = PO_RDONLY | PO_NOSAVE,
|
||||
.get = mpegts_mux_class_get_name,
|
||||
},
|
||||
{
|
||||
.type = PT_U16,
|
||||
.id = "onid",
|
||||
|
|
Loading…
Add table
Reference in a new issue