From 3254bbbf2e06e9013e8468643344683cf2783f50 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 5 Nov 2019 10:52:12 +0100 Subject: VLC: do not restart after exit callback if m_running false --- src/VLCInput.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/VLCInput.cpp b/src/VLCInput.cpp index 80e85be..d2ae4f0 100644 --- a/src/VLCInput.cpp +++ b/src/VLCInput.cpp @@ -291,13 +291,18 @@ void VLCInput::preRender_cb(uint8_t** pp_pcm_buffer, size_t size) void VLCInput::exit_cb() { - std::lock_guard lock(m_queue_mutex); + if (m_running) { + std::lock_guard lock(m_queue_mutex); - fprintf(stderr, "VLC exit, restarting...\n"); + fprintf(stderr, "VLC exit, restarting...\n"); - cleanup(); - m_current_buf.clear(); - prepare(); + cleanup(); + m_current_buf.clear(); + prepare(); + } + else { + fprintf(stderr, "VLC exit.\n"); + } } void VLCInput::cleanup() -- cgit v1.2.3