From 4c1f949995d77bb5a0ac452aa0d78e01eeea07cb Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sun, 24 Oct 2021 15:35:49 +0100 Subject: [PATCH] Message queue fix for VVideoRec --- playervideorec.cc | 2 +- vvideorec.cc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/playervideorec.cc b/playervideorec.cc index afcdac0..1cedf9a 100644 --- a/playervideorec.cc +++ b/playervideorec.cc @@ -1208,7 +1208,7 @@ void PlayerVideoRec::threadFeedPlay() m->from = this; m->message = Message::PLAYER_EVENT; m->parameter = PlayerVideoRec::STOP_PLAYBACK; - logger->debug(TAG, "Posting message to {}...", (void*)messageQueue); + logger->debug(TAG, "Posting message to {}...", static_cast(messageReceiver)); messageQueue->postMessage(m); } diff --git a/vvideorec.cc b/vvideorec.cc index 844e41f..a2b9a4c 100644 --- a/vvideorec.cc +++ b/vvideorec.cc @@ -118,6 +118,8 @@ VVideoRec::VVideoRec(Recording* rec, bool ish264) vdisplay.y=0; vdisplay.width=0; vdisplay.height=0; + + MessageQueue::getInstance()->addReceiver(this); } void VVideoRec::preDelete() @@ -138,6 +140,8 @@ void VVideoRec::preDelete() VVideoRec::~VVideoRec() { + MessageQueue::getInstance()->removeReceiver(this); + LogNT::getInstance()->debug(TAG, "Entering vvideorec destructor"); video->setDefaultAspect(); -- 2.39.5