From 9091719dc9f379d36292e46f5e777ec4a5860654 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 6 Jan 2017 16:18:14 +0000 Subject: [PATCH] Catch exception in PlaYUVerTools --- tools/PlaYUVerTools.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/PlaYUVerTools.cpp b/tools/PlaYUVerTools.cpp index a1d8a4e..2741819 100644 --- a/tools/PlaYUVerTools.cpp +++ b/tools/PlaYUVerTools.cpp @@ -281,9 +281,13 @@ Int PlaYUVerTools::Open( Int argc, Char *argv[] ) pcModFrame = applyFrameModule(); } PlaYUVerStream* pcModStream = new PlaYUVerStream; - if( !pcModStream->open( outputFileNames[0], pcModFrame->getWidth(), pcModFrame->getHeight(), pcModFrame->getPelFormat(), pcModFrame->getBitsPel(), - pcModFrame->getEndianness(), 1, false ) ) + try { + pcModStream->open( outputFileNames[0], pcModFrame->getWidth(), pcModFrame->getHeight(), pcModFrame->getPelFormat(), pcModFrame->getBitsPel(), pcModFrame->getEndianness(), 1, false ); + } + catch( const char *msg ) + { + log( LOG_ERROR, "Cannot open input stream %s with the following error %s!\n", outputFileNames[0].c_str(), msg ); delete pcModStream; pcModStream = NULL; return 2;