From 25e075244025a930b9f6dda16138eca9d9877643 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 5 Feb 2018 16:17:36 +0100 Subject: Catch and handle VLC initialisation failure --- src/VLCInput.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/VLCInput.cpp b/src/VLCInput.cpp index 36c77fa..5912509 100644 --- a/src/VLCInput.cpp +++ b/src/VLCInput.cpp @@ -227,6 +227,10 @@ void VLCInput::prepare() // Launch VLC m_vlc = libvlc_new(arg_ix, vlc_args); + if (m_vlc == nullptr) { + throw runtime_error("VLC initialisation failed"); + } + libvlc_set_exit_handler(m_vlc, handleVLCExit, this); // Load the media -- cgit v1.2.3