]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
dvr: ensure subsystems are notified when dvr starts (and filename is set)
authorAdam Sutton <dev@adamsutton.me.uk>
Thu, 31 Jan 2013 11:14:59 +0000 (11:14 +0000)
committerAdam Sutton <dev@adamsutton.me.uk>
Thu, 31 Jan 2013 11:30:09 +0000 (11:30 +0000)
src/dvr/dvr_rec.c

index bf6a02e2b20b14b9928a096ba5f0c1d5bef2d287..adcb4302f8bf030ea5b13b58f1e90f911b2b35ad 100644 (file)
@@ -32,6 +32,7 @@
 #include "service.h"
 #include "plumbing/tsfix.h"
 #include "plumbing/globalheaders.h"
+#include "htsp_server.h"
 
 #include "muxer.h"
 
@@ -465,11 +466,15 @@ dvr_thread(void *aux)
       }
 
       if(!started) {
-       pthread_mutex_lock(&global_lock);
-       dvr_rec_set_state(de, DVR_RS_WAIT_PROGRAM_START, 0);
-       if(dvr_rec_start(de, sm->sm_data) == 0)
-         started = 1;
-       pthread_mutex_unlock(&global_lock);
+        pthread_mutex_lock(&global_lock);
+        dvr_rec_set_state(de, DVR_RS_WAIT_PROGRAM_START, 0);
+        if(dvr_rec_start(de, sm->sm_data) == 0) {
+          started = 1;
+          dvr_entry_notify(de);
+          htsp_dvr_entry_update(de);
+          dvr_entry_save(de);
+        }
+        pthread_mutex_unlock(&global_lock);
       } 
       break;