diff --git a/src/input/mpegts/linuxdvb/linuxdvb_switch.c b/src/input/mpegts/linuxdvb/linuxdvb_switch.c index 9c7aebc7..dabe2590 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_switch.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_switch.c @@ -105,12 +105,12 @@ static int linuxdvb_switch_tune ( linuxdvb_diseqc_t *ld, linuxdvb_mux_t *lm, linuxdvb_satconf_t *sc, int fd ) { - int i, r = 0; + int i, s, r = 0; linuxdvb_switch_t *ls = (linuxdvb_switch_t*)ld; /* Single committed (before repeats) */ - if (sc->ls_diseqc_repeats && ls->ls_committed) { - int s = 0xF0 | (ls->ls_committed - 1); + if (sc->ls_diseqc_repeats > 0) { + s = 0xF0 | ls->ls_committed; if (linuxdvb_diseqc_send(fd, 0xE0, 0x10, 0x38, 1, s)) return -1; usleep(25000); // 25ms @@ -120,32 +120,26 @@ linuxdvb_switch_tune for (i = 0; i <= sc->ls_diseqc_repeats; i++) { /* Uncommitted */ - if (ls->ls_uncomitted) { - int s = 0xF0 | (ls->ls_uncomitted - 1); - if (linuxdvb_diseqc_send(fd, 0xE0 | r, 0x10, 0x39, 1, s)) - return -1; - usleep(25000); - } + s = 0xF0 | ls->ls_uncomitted; + if (linuxdvb_diseqc_send(fd, 0xE0 | r, 0x10, 0x39, 1, s)) + return -1; + usleep(25000); /* Committed */ - if (ls->ls_committed) { - int s = 0xF0 | (ls->ls_committed - 1); - if (linuxdvb_diseqc_send(fd, 0xE1, 0x10, 0x38, 1, s)) - return -1; - usleep(25000); - } + s = 0xF0 | ls->ls_committed; + if (linuxdvb_diseqc_send(fd, 0xE1, 0x10, 0x38, 1, s)) + return -1; + usleep(25000); /* repeat flag */ r = 1; } /* Tone burst */ - if (ls->ls_toneburst) { - tvhtrace("linuxdvb", "toneburst %s", ls->ls_toneburst == 2 ? "on" : "off"); - if (ioctl(fd, FE_SET_TONE, ls->ls_toneburst ? SEC_TONE_ON : SEC_TONE_OFF)) { - tvherror("linuxdvb", "failed to set toneburst (e=%s)", strerror(errno)); - return -1; - } + tvhtrace("linuxdvb", "toneburst %s", ls->ls_toneburst ? "on" : "off"); + if (ioctl(fd, FE_SET_TONE, ls->ls_toneburst ? SEC_TONE_ON : SEC_TONE_OFF)) { + tvherror("linuxdvb", "failed to set toneburst (e=%s)", strerror(errno)); + return -1; } return 0; diff --git a/src/webui/extjs.c b/src/webui/extjs.c index 59635d16..5cee21ff 100644 --- a/src/webui/extjs.c +++ b/src/webui/extjs.c @@ -2242,8 +2242,6 @@ extjs_idnode if (!out) return HTTP_STATUS_BAD_REQUEST; -printf("IDNODE: %s %s\n", uuid, op); -htsmsg_print(out); htsmsg_json_serialize(out, hq, 0); htsmsg_destroy(out); diff --git a/src/webui/static/app/idnode.js b/src/webui/static/app/idnode.js index c52fff37..3f739808 100644 --- a/src/webui/static/app/idnode.js +++ b/src/webui/static/app/idnode.js @@ -68,7 +68,19 @@ tvheadend.idnode_editor_field = function(f, create) case 'u16': case 'dbl': if (f.enum) { - var store = f.enum; + var data = null; + if (f.enum.length > 0 && f.enum[0] instanceof Object) { + data = f.enum; + } else { + data = [] + for ( i = 0; i < f.enum.length; i++ ) + data.push({ key: i, val: f.enum[i]}); + } + var store = new Ext.data.JsonStore({ + id : 'key', + fields : [ 'key', 'val' ], + data : data + }); return new Ext.form.ComboBox({ fieldLabel : f.caption, name : f.id,