]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
epg: fix epg_broadcast_set_running() - call _epg_object_set_updated()
authorJaroslav Kysela <perex@perex.cz>
Fri, 3 Nov 2017 14:11:04 +0000 (15:11 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 3 Nov 2017 15:23:14 +0000 (16:23 +0100)
src/epg.c

index 474c7e13bf3517515b7280bec4335550dd11c580..5bc2801b2c4640d27124646ad2072bee72fbf291 100644 (file)
--- a/src/epg.c
+++ b/src/epg.c
@@ -179,16 +179,20 @@ static int _epg_object_putref ( void *o )
   return 0;
 }
 
-static void _epg_object_set_updated ( void *o )
+static void _epg_object_set_updated0 ( void *o )
 {
   epg_object_t *eo = o;
-  if (!eo->_updated) {
-    tvhtrace(LS_EPG, "eo [%p, %u, %d, %s] updated",
-             eo, eo->id, eo->type, eo->uri);
-    eo->_updated = 1;
-    eo->updated  = gclk();
-    LIST_INSERT_HEAD(&epg_object_updated, eo, up_link);
-  }
+  tvhtrace(LS_EPG, "eo [%p, %u, %d, %s] updated",
+           eo, eo->id, eo->type, eo->uri);
+  eo->_updated = 1;
+  eo->updated  = gclk();
+  LIST_INSERT_HEAD(&epg_object_updated, eo, up_link);
+}
+
+static inline void _epg_object_set_updated ( void *o )
+{
+  if (!((epg_object_t *)o)->_updated)
+    _epg_object_set_updated0(o);
 }
 
 static int _epg_object_can_remove ( void *_old, void *_new )
@@ -2086,8 +2090,12 @@ epg_broadcast_t *epg_broadcast_find_by_eid ( channel_t *ch, uint16_t eid )
 int epg_broadcast_set_running
   ( epg_broadcast_t *broadcast, epg_running_t running )
 {
-  int save = running != broadcast->running;
-  broadcast->update_running = running;
+  int save = 0;
+  if (running != broadcast->running) {
+    broadcast->update_running = running;
+    _epg_object_set_updated(broadcast);
+    save = 1;
+  }
   return save;
 }