diff --git a/src/epg.c b/src/epg.c index e031ae07..280b8108 100644 --- a/src/epg.c +++ b/src/epg.c @@ -1396,12 +1396,16 @@ static void _epg_channel_timer_callback ( void *p ) break; } - /* Change */ - if (cur != ch->ch_epg_now || nxt != ch->ch_epg_next) + /* Change (update HTSP) */ + if (cur != ch->ch_epg_now || nxt != ch->ch_epg_next) { tvhlog(LOG_DEBUG, "epg", "now/next %u/%u set on %s", ch->ch_epg_now ? ch->ch_epg_now->id : 0, ch->ch_epg_next ? ch->ch_epg_next->id : 0, ch->ch_name); + tvhlog(LOG_DEBUG, "epg", "inform HTSP of now event change on %s", + ch->ch_name); + htsp_channel_update_nownext(ch); + } /* re-arm */ if ( next ) { @@ -1410,13 +1414,6 @@ static void _epg_channel_timer_callback ( void *p ) gtimer_arm_abs(&ch->ch_epg_timer, _epg_channel_timer_callback, ch, next); } - /* Update HTSP */ - if ( cur != ch->ch_epg_now ) { - tvhlog(LOG_DEBUG, "epg", "inform HTSP of now event change on %s", - ch->ch_name); - htsp_channel_update_current(ch); - } - /* Remove refs */ if (cur) cur->putref(cur); if (nxt) nxt->putref(nxt); diff --git a/src/htsp_server.c b/src/htsp_server.c index 8a6ce451..e5234e96 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -2161,13 +2161,13 @@ htsp_async_send(htsmsg_t *m, int mode) /** - * EPG subsystem calls this function when the current event + * EPG subsystem calls this function when the current/next event * changes for a channel, e may be NULL if there is no current event. * * global_lock is held */ void -htsp_channel_update_current(channel_t *ch) +htsp_channel_update_nownext(channel_t *ch) { epg_broadcast_t *now, *next; htsmsg_t *m; diff --git a/src/htsp_server.h b/src/htsp_server.h index 77002cac..f551ab89 100644 --- a/src/htsp_server.h +++ b/src/htsp_server.h @@ -24,7 +24,7 @@ void htsp_init(const char *bindaddr); -void htsp_channel_update_current(channel_t *ch); +void htsp_channel_update_nownext(channel_t *ch); void htsp_channel_add(channel_t *ch); void htsp_channel_update(channel_t *ch);