]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
htsp: update the EPG/HTSP hookup to send channelUpdate on next event change.
authorAdam Sutton <dev@adamsutton.me.uk>
Wed, 22 May 2013 11:53:32 +0000 (12:53 +0100)
committerAdam Sutton <dev@adamsutton.me.uk>
Wed, 22 May 2013 11:55:00 +0000 (12:55 +0100)
Previously this was only being output if the current event was updated.

src/epg.c
src/htsp_server.c
src/htsp_server.h

index e031ae07972423b08a6b4c42887e47ee4867338c..280b81085dde815b5f51ab7e8bac9684999f0067 100644 (file)
--- 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);
index 8a6ce4513b832b95ceff8b3a616a078bc02fd736..e5234e96ae2420dc453a9e5aa3e960c21192dcba 100644 (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;
index 77002cac284af76f78e271132a380608983e4230..f551ab899bb7f7b43bc933227e14d56a0b47511f 100644 (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);