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 ) {
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);
/**
- * 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;
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);