if(v > 1)
ch->ch_commercial_detection = v;
}
+
+ if((x = config_get_str_sub(&cl, "icon", NULL)) != NULL)
+ ch->ch_icon = strdup(x);
}
config_free0(&cl);
}
fprintf(fp, "name = %s\n", ch->ch_name);
fprintf(fp, "channel-group = %s\n", ch->ch_group->tcg_name);
-
+ fprintf(fp, "icon = %s\n", ch->ch_icon);
fprintf(fp, "commercial-detect = %s\n",
val2str(ch->ch_commercial_detection, commercial_detect_tab) ?: "?");
fclose(fp);
epg_lock();
- free(ch->ch_icon);
- ch->ch_icon = icon ? strdup(icon) : NULL;
+
+ if(strcmp(icon ?: "", ch->ch_icon ?: "")) {
+ free(ch->ch_icon);
+ ch->ch_icon = icon ? strdup(icon) : NULL;
+ channel_settings_write(ch);
+ }
TAILQ_FOREACH(e, src, e_link) {
*/
#define _GNU_SOURCE
+#include <errno.h>
#include <string.h>
#include <sys/types.h>
regrab(void *aux, int64_t now)
{
xmltv_grabber_t *xg = aux;
-
xmltv_grabber_enqueue(xg);
}
xmltv_xfer(void *aux, int64_t now)
{
xmltv_grabber_t *xg = aux;
+ int t;
+
+ /* We don't want to stall waiting for the xml decoding which
+ can take quite some time, instead retry in a second if we fail
+ to obtain mutex */
+
+ if(pthread_mutex_trylock(&xg->xg_mutex) == EBUSY) {
+ t = 1;
+ } else {
+ xmltv_transfer_events(xg);
+ pthread_mutex_unlock(&xg->xg_mutex);
+ t = 60;
+ }
- xmltv_transfer_events(xg);
-
- dtimer_arm(&xg->xg_xfer_timer, xmltv_xfer, xg, 60);
+ dtimer_arm(&xg->xg_xfer_timer, xmltv_xfer, xg, t);
}
/**