htsp: update the EPG/HTSP hookup to send channelUpdate on next event change.

Previously this was only being output if the current event was updated.
This commit is contained in:
Adam Sutton 2013-05-22 12:53:32 +01:00
parent a5a08aa1e5
commit 15fa7adc22
3 changed files with 9 additions and 12 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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);