Some fixes to EIT scanner and UI.

This commit is contained in:
Adam Sutton 2012-06-29 23:02:38 +01:00
parent 19cbe54f6b
commit 849309b5f4
4 changed files with 18 additions and 18 deletions

View file

@ -133,7 +133,7 @@ static void _epggrab_load ( void )
if ( (a = htsmsg_get_map(m, "mod_enabled")) ) {
LIST_FOREACH(mod, &epggrab_modules, link) {
if (htsmsg_get_u32_or_default(a, mod->id, 0)) {
if (mod->enable) mod->enable(mod, 1);
epggrab_enable_module(mod, 1);
}
}
}
@ -230,11 +230,9 @@ int epggrab_set_module ( epggrab_module_t *m )
if (m && m->type != EPGGRAB_INT) return 0;
mod = (epggrab_module_int_t*)m;
if ( epggrab_module != mod ) {
if (epggrab_module && epggrab_module->enable)
epggrab_module->enable(epggrab_module, 0);
epggrab_enable_module((epggrab_module_t*)epggrab_module, 0);
epggrab_module = (epggrab_module_int_t*)mod;
if (epggrab_module && epggrab_module->enable)
epggrab_module->enable(epggrab_module, 1);
epggrab_enable_module((epggrab_module_t*)epggrab_module, 1);
save = 1;
}
return save;
@ -278,6 +276,7 @@ int epggrab_set_channel_reicon ( uint32_t e )
int epggrab_enable_module ( epggrab_module_t *mod, uint8_t e )
{
int save = 0;
if (!mod) return 0;
if (mod->enable) {
save = mod->enable(mod, e);
} else if ( e != mod->enabled ) {

View file

@ -45,13 +45,13 @@ static void _eit_dtag_dump ( uint8_t dtag, uint8_t dlen, uint8_t *buf )
{
int i = 0, j = 0;
char tmp[100];
tvhlog(LOG_DEBUG, "eit", "dtag 0x%02X len %d\n", dtag, dlen);
while (i < dlen)
while (dlen--) {
tvhlog(LOG_DEBUG, "eit", " dtag 0x%02X len %d", dtag, dlen);
while (i < dlen) {
j += sprintf(tmp+j, "%02X ", buf[i]);
i++;
if ((i % 8) == 0 || !dlen) {
tvhlog(LOG_DEBUG, "eit", " %s", tmp);
tvhlog(LOG_DEBUG, "eit", " %s", tmp);
j = 0;
}
}
}
@ -201,6 +201,7 @@ static int _eit_callback
svc = dvb_transport_find(tdmi, sid, 0, NULL);
if (!svc || !svc->s_enabled || !(ch = svc->s_ch)) return 0;
/* Ignore (disabled) */
// TODO: should this be altered?
if (!svc->s_dvb_eit_enable) return 0;

View file

@ -265,7 +265,6 @@ void epggrab_ota_complete ( epggrab_ota_mux_t *ota )
if (ota->state != EPGGRAB_OTA_MUX_COMPLETE) {
ota->state = EPGGRAB_OTA_MUX_COMPLETE;
time(&ota->completed);
_epggrab_ota_finished(ota);
/* Check others */
TAILQ_FOREACH(ota, &tdmi->tdmi_epg_grab, tdmi_link) {
@ -291,6 +290,7 @@ void epggrab_ota_cancel ( epggrab_ota_mux_t *ota )
void epggrab_ota_timeout ( epggrab_ota_mux_t *ota )
{
epggrab_ota_complete(ota);
_epggrab_ota_finished(ota);
}
/*

View file

@ -7,16 +7,16 @@ tvheadend.epggrab = function() {
/*
* Module lists (I'm sure there is a better way!)
*/
var EPGGRAB_MODULE_INTERNAL = 0x01;
var EPGGRAB_MODULE_EXTERNAL = 0x02;
var EPGGRAB_MODULE_OTA = 0x04;
var EPGGRAB_MODULE_INTERNAL = 0;
var EPGGRAB_MODULE_EXTERNAL = 1;
var EPGGRAB_MODULE_OTA = 2;
var moduleStore = new Ext.data.JsonStore({
root : 'entries',
url : 'epggrab',
baseParams : { op : 'moduleList' },
autoLoad : true,
fields : [ 'id', 'name', 'path', 'flags', 'enabled' ]
fields : [ 'id', 'name', 'path', 'type', 'enabled' ]
});
var internalModuleStore = new Ext.data.Store({
recordType: moduleStore.recordType
@ -29,7 +29,7 @@ tvheadend.epggrab = function() {
});
moduleStore.on('load', function() {
moduleStore.filterBy(function(r) {
return r.get('flags') & EPGGRAB_MODULE_INTERNAL;
return r.get('type') == EPGGRAB_MODULE_INTERNAL;
});
r = new internalModuleStore.recordType({ id: '', name : 'Disabled'});
internalModuleStore.add(r);
@ -37,19 +37,19 @@ tvheadend.epggrab = function() {
internalModuleStore.add(r.copy());
});
moduleStore.filterBy(function(r) {
return r.get('flags') & EPGGRAB_MODULE_EXTERNAL;
return r.get('type') == EPGGRAB_MODULE_EXTERNAL;
});
moduleStore.each(function(r) {
externalModuleStore.add(r.copy());
});
moduleStore.filterBy(function(r) {
return r.get('flags') & EPGGRAB_MODULE_OTA;
return r.get('type') == EPGGRAB_MODULE_OTA;
});
moduleStore.each(function(r) {
otaModuleStore.add(r.copy());
});
moduleStore.filterBy(function(r) {
return r.get('flags') & (EPGGRAB_MODULE_OTA | EPGGRAB_MODULE_EXTERNAL);
return r.get('type') != EPGGRAB_MODULE_INTERNAL;
});
});