From 123ee740768e0b1d990a1af26e273a1e4af8b595 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Tue, 14 Sep 2021 14:47:35 +0100 Subject: [PATCH] Fix crash when ffwd/rev after pause. Some log fixes --- control.cc | 11 ++++++----- playervideorec.cc | 7 +++++++ recinfo.cc | 6 +++--- videoomx.cc | 4 ++-- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/control.cc b/control.cc index 2f747a5..8666cf3 100644 --- a/control.cc +++ b/control.cc @@ -1069,20 +1069,20 @@ void Control::doJustConnected(VConnect* vconnect) { if (!STRCASECMP(config, "S-Video")) { - logger->info(TAG, "Switching to S-Video as Connection=%s", config); + logger->info(TAG, "Switching to S-Video as Connection={}", config); video->setConnection(Video::SVIDEO); } else if (!STRCASECMP(config, "HDMI")) { - logger->info(TAG, "Switching to HDMI as Connection=%s", config); + logger->info(TAG, "Switching to HDMI as Connection={}", config); video->setConnection(Video::HDMI); } else if (!STRCASECMP(config, "HDMI3D")) { - logger->info(TAG, "Switching to HDMI3D as Connection=%s", config); + logger->info(TAG, "Switching to HDMI3D as Connection={}", config); video->setConnection(Video::HDMI3D); } else { - logger->info(TAG, "Switching to RGB/Composite as Connection=%s", config); + logger->info(TAG, "Switching to RGB/Composite as Connection={}", config); video->setConnection(Video::COMPOSITERGB); } delete[] config; @@ -1265,8 +1265,9 @@ void Control::doJustConnected(VConnect* vconnect) // handleCommand(Input::OK); // handleCommand(Input::THREE); // handleCommand(Input::SIX); -// handleCommand(Input::OK); // handleCommand(Input::UP); +// handleCommand(Input::OK); +// handleCommand(Input::OK); // handleCommand(Input::PLAY); // handleCommand(Input::DOWN); // handleCommand(Input::DOWN); diff --git a/playervideorec.cc b/playervideorec.cc index 43793d8..046346b 100644 --- a/playervideorec.cc +++ b/playervideorec.cc @@ -135,6 +135,13 @@ void PlayerVideoRec::threadStart() void PlayerVideoRec::threadStop() { playerThreadMutex.lock(); + + if (!playerThread.joinable()) // restartAtFrame sometimes calls threadStop when it's not running + { + playerThreadMutex.unlock(); + return; + } + threadReqQuit = true; playerThreadCond.notify_one(); playerThreadMutex.unlock(); diff --git a/recinfo.cc b/recinfo.cc index bfcdd9b..77e9056 100644 --- a/recinfo.cc +++ b/recinfo.cc @@ -54,14 +54,14 @@ RecInfo::RecInfo() RecInfo::~RecInfo() { - LogNT::getInstance()->info(TAG, "Deleting recinfo: %lu, %s", numComponents, summary); + LogNT::getInstance()->info(TAG, "Deleting recinfo: {}, {}", numComponents, summary); if (summary) delete[] summary; for (ULONG i = 0; i < numComponents; i++) { - LogNT::getInstance()->info(TAG, "i: %lu, languages[i]=%p:%s", i, languages[i], languages[i]); - LogNT::getInstance()->info(TAG, "i: %lu, descripti[i]=%p:%s", i, descriptions[i], descriptions[i]); + LogNT::getInstance()->info(TAG, "i: {}, languages[i]={:p}:{}", i, (void*)languages[i], languages[i]); + LogNT::getInstance()->info(TAG, "i: {}, descripti[i]={:p}:{}", i, (void*)descriptions[i], descriptions[i]); if (languages[i]) delete[] (languages[i]); if (descriptions[i]) delete[] (descriptions[i]); } diff --git a/videoomx.cc b/videoomx.cc index 9986b28..681f2b3 100644 --- a/videoomx.cc +++ b/videoomx.cc @@ -914,7 +914,7 @@ int VideoOMX::initClock() } - logger->debug(TAG, "init omx clock {:#x} {:#x}", (void*)this, omx_clock); + logger->debug(TAG, "init omx clock {:p} {}", (void*)this, omx_clock); clock_references++; clock_mutex.unlock(); return 1; @@ -1834,7 +1834,7 @@ int VideoOMX::WaitForEvent(OMX_HANDLETYPE handle,OMX_U32 event, int wait) //need i++; } - logger->debug(TAG, "WaitForEvent waited too long {:#x} {:#x}",handle,event); + logger->debug(TAG, "WaitForEvent waited too long {:p} {:#x}",(void*)handle,event); return 0; } -- 2.39.2