]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
mpegts input: do not join non-existent threads
authorJaroslav Kysela <perex@perex.cz>
Wed, 20 Jun 2018 13:08:03 +0000 (15:08 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 20 Jun 2018 13:08:03 +0000 (15:08 +0200)
src/input/mpegts/mpegts_input.c

index 52f617ee6d63dce729c3f640c4b7f523f0602a07..51deeefcb58e8b7f0776763cfba392462e06c152 100644 (file)
@@ -1953,8 +1953,10 @@ mpegts_input_thread_stop ( mpegts_input_t *mi )
 
   /* Join threads (relinquish lock due to potential deadlock) */
   pthread_mutex_unlock(&global_lock);
-  pthread_join(mi->mi_input_tid, NULL);
-  pthread_join(mi->mi_table_tid, NULL);
+  if (mi->mi_input_tid)
+    pthread_join(mi->mi_input_tid, NULL);
+  if (mi->mi_table_tid)
+    pthread_join(mi->mi_table_tid, NULL);
   pthread_mutex_lock(&global_lock);
 }