]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Added locking of stream mutex to mpegts_input_postdemux
authorJasmin Jessich <jasmin@anw.at>
Sat, 17 Feb 2018 19:37:29 +0000 (20:37 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sun, 25 Feb 2018 17:58:17 +0000 (18:58 +0100)
Signed-off-by: Jasmin Jessich <jasmin@anw.at>
src/input/mpegts/mpegts_input.c

index e0f2b5d5d5fbb8903f7eff7d50803f30219b0fa5..9ac70ca60439ca3c34c6020c155eb3228e8a2bd9 100644 (file)
@@ -1597,15 +1597,19 @@ mpegts_input_postdemux
       if (type & MPS_SERVICE) {
         LIST_FOREACH(mps, &mp->mp_svc_subs, mps_svcraw_link) {
           s = mps->mps_owner;
+          pthread_mutex_lock(&s->s_stream_mutex);
           st = service_stream_find(s, pid);
           ts_recv_packet0((mpegts_service_t*)s, st, tsb, llen);
+          pthread_mutex_unlock(&s->s_stream_mutex);
         }
       } else
       /* Stream table data */
       if (type & MPS_STREAM) {
         LIST_FOREACH(s, &mm->mm_transports, s_active_link) {
           if (s->s_type != STYPE_STD) continue;
+          pthread_mutex_lock(&s->s_stream_mutex);
           ts_recv_packet0((mpegts_service_t*)s, NULL, tsb, llen);
+          pthread_mutex_unlock(&s->s_stream_mutex);
         }
       }