]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
scanfile_init: fix mutex locking - fixes #4033
authorJaroslav Kysela <perex@perex.cz>
Sat, 22 Oct 2016 19:09:20 +0000 (21:09 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sat, 22 Oct 2016 19:09:20 +0000 (21:09 +0200)
src/input/mpegts/scanfile.c

index d02d11841d902a2436a67c63042ec230fb902abe..119e2fcc3d6b1c21d458a7b90bfc9555141613c3 100644 (file)
@@ -906,8 +906,12 @@ scanfile_init ( const char *muxconf_path, int lock )
 #endif
 
   if (!initialized) {
+    if (lock)
+      pthread_mutex_lock(&global_lock);
     memoryinfo_register(&scanfile_memoryinfo);
     initialized = 1;
+    if (lock)
+      pthread_mutex_lock(&global_lock);
   }
 
   scanfile_total_load = 0;