Must initialize stop_

This commit is contained in:
Isaac Connor 2021-03-23 10:07:55 -04:00
parent e51fe9eb4a
commit 456afac0ec
1 changed files with 3 additions and 0 deletions

View File

@ -25,6 +25,7 @@ ZoneMinderFifoSource::ZoneMinderFifoSource(
xop::MediaChannelId channelId,
std::string fifo
) :
stop_(false),
m_rtspServer(rtspServer),
m_sessionId(sessionId),
m_channelId(channelId),
@ -47,6 +48,7 @@ ZoneMinderFifoSource::~ZoneMinderFifoSource() {
// thread mainloop
void ZoneMinderFifoSource::ReadRun() {
if (!stop_) Warning("bad value for stop_ in ReadRun");
while (!stop_) {
if (getNextFrame() < 0) {
Debug(1, "Sleeping");
@ -55,6 +57,7 @@ void ZoneMinderFifoSource::ReadRun() {
}
}
void ZoneMinderFifoSource::WriteRun() {
if (!stop_) Warning("bad value for stop_ in WriteRun");
while (!stop_) {
std::unique_lock<std::mutex> lck(mutex_);
if (m_nalQueue.empty()) {