Project

General

Profile

Bug #5558 » inuxdvb_frontend_monitor.txt

Deep Thought, 2019-03-18 22:12

 
1
diff --git a/src/input/mpegts/linuxdvb/linuxdvb_frontend.c b/src/input/mpegts/linuxdvb/linuxdvb_frontend.c
2
index 19aa2fcc7..b112ca9a1 100644
3
--- a/src/input/mpegts/linuxdvb/linuxdvb_frontend.c
4
+++ b/src/input/mpegts/linuxdvb/linuxdvb_frontend.c
5
@@ -845,7 +845,7 @@ ioctl_bad( linuxdvb_frontend_t *lfe, int bit )
6
 }
7
 
8
 static void
9
-linuxdvb_frontend_monitor ( void *aux )
10
+linuxdvb_frontend_monitor_ ( void *aux )
11
 {
12
   uint16_t u16;
13
   uint32_t u32;
14
@@ -875,11 +875,14 @@ linuxdvb_frontend_monitor ( void *aux )
15
 
16
   /* Close FE */
17
   if (lfe->lfe_fe_fd > 0 && !lfe->lfe_refcount && lfe->lfe_powersave) {
18
+    tvh_mutex_lock(&global_lock);//DEEPTHO
19
     if (lfe->lfe_satconf && linuxdvb_satconf_power_save(lfe->lfe_satconf) > 0) {
20
       /* re-arm */
21
       mtimer_arm_rel(&lfe->lfe_monitor_timer, linuxdvb_frontend_monitor, lfe, sec2mono(1));
22
+      tvh_mutex_unlock(&global_lock);//DEEPTHO
23
       return;
24
     }
25
+    tvh_mutex_unlock(&global_lock);//DEEPTHO
26
     linuxdvb_frontend_close_fd(lfe, buf);
27
     return;
28
   }
29
@@ -966,9 +969,10 @@ linuxdvb_frontend_monitor ( void *aux )
30
       tvh_mutex_unlock(&lfe->lfe_dvr_lock);
31
 
32
       /* Table handlers */
33
+      tvh_mutex_lock(&global_lock);//DEEPTHO
34
       psi_tables_install((mpegts_input_t *)lfe, mm,
35
                          ((dvb_mux_t *)mm)->lm_tuning.dmc_fe_delsys);
36
-
37
+      tvh_mutex_unlock(&global_lock); //DEEPTHO
38
     /* Re-arm (quick) */
39
     } else {
40
       mtimer_arm_rel(&lfe->lfe_monitor_timer, linuxdvb_frontend_monitor,
41
@@ -1241,6 +1245,16 @@ linuxdvb_frontend_monitor ( void *aux )
42
   }
43
 }
44
 
45
+static void
46
+linuxdvb_frontend_monitor( void *aux )
47
+{
48
+  tvh_mutex_unlock(&global_lock);
49
+  linuxdvb_frontend_monitor_(aux);
50
+  tvh_mutex_lock(&global_lock);
51
+
52
+}
53
+
54
+
55
 typedef struct linuxdvb_pid {
56
   int fd;
57
   int pid;
(2-2/2)