From e9ebc3b2c159dc9e352e85703309e5b4f5d48948 Mon Sep 17 00:00:00 2001 From: Klaas de Waal Date: Sat, 30 Nov 2024 17:43:01 +0100 Subject: [PATCH] Commit text Lock access to m_tsAvListeners in mpegstreamdata.cpp Use the m_listenerLock for all usage of m_tsAvListeners in mpegstreamdata.cpp. This lock was used in some places but not everywhere. This has caused segfaults in mythbackend, observed when testing recent IPTV bug fixes. --- mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp b/mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp index 6b7792c4428..d69c6ef1c5e 100644 --- a/mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp +++ b/mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp @@ -1048,6 +1048,8 @@ bool MPEGStreamData::ProcessTSPacket(const TSPacket& tspacket) if (IsVideoPID(tspacket.PID())) { + QMutexLocker locker(&m_listenerLock); + for (auto & listener : m_tsAvListeners) listener->ProcessVideoTSPacket(tspacket); @@ -1056,6 +1058,8 @@ bool MPEGStreamData::ProcessTSPacket(const TSPacket& tspacket) if (IsAudioPID(tspacket.PID())) { + QMutexLocker locker(&m_listenerLock); + for (auto & listener : m_tsAvListeners) listener->ProcessAudioTSPacket(tspacket);