Commit b2ba93f7 authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

avmodel: catch exception when trying to init preview renderer

Change-Id: Id5c9872554d327da8bad182f977e2b3bcf9ac9c8
Gitlab: #506
parent 7bf617d2
......@@ -636,9 +636,15 @@ AVModelPimpl::AVModelPimpl(AVModel& linked, const CallbacksHandler& callbacksHan
{
std::srand(std::time(nullptr));
// add preview renderer
renderers_.insert(std::make_pair(video::PREVIEW_RENDERER_ID,
std::make_unique<video::Renderer>(video::PREVIEW_RENDERER_ID,
linked_.getDeviceSettings(linked_.getDefaultDeviceName()),"", useAVFrame_)));
try {
renderers_.insert(std::make_pair(video::PREVIEW_RENDERER_ID,
std::make_unique<video::Renderer>(video::PREVIEW_RENDERER_ID,
linked_.getDeviceSettings(linked_.getDefaultDeviceName()),
"",
useAVFrame_)));
} catch (const std::out_of_range& e) {
qWarning() << "Couldn't setup video input renderer: " << e.what();
}
#ifndef ENABLE_LIBWRAP
SIZE_RENDERER = renderers_.size();
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment