]> git.vomp.tv Git - vompclient.git/commitdiff
Message queue fix for VVideoRec
authorChris Tallon <chris@vomp.tv>
Sun, 24 Oct 2021 14:35:49 +0000 (15:35 +0100)
committerChris Tallon <chris@vomp.tv>
Sun, 24 Oct 2021 14:35:49 +0000 (15:35 +0100)
playervideorec.cc
vvideorec.cc

index afcdac00e6ef214bde5915c75845ed3304efd580..1cedf9ac8fd663b9c9fa051e9f993f7eccec0fea 100644 (file)
@@ -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<void*>(messageReceiver));
   messageQueue->postMessage(m);
 }
 
index 844e41f3108b043b873fa7aeaf8602b3358bb9cc..a2b9a4ccaff2dedb5054de3dc065cac3d2e185fd 100644 (file)
@@ -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();