summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-11-05 10:52:12 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-11-05 10:52:12 +0100
commit3254bbbf2e06e9013e8468643344683cf2783f50 (patch)
tree0a8084c5f8f162677178e9ff7ff1ea430773a2c8
parentc458a9e3cbf2fcf800f38a6a26d4a1ab6bb41cd0 (diff)
downloadODR-AudioEnc-3254bbbf2e06e9013e8468643344683cf2783f50.tar.gz
ODR-AudioEnc-3254bbbf2e06e9013e8468643344683cf2783f50.tar.bz2
ODR-AudioEnc-3254bbbf2e06e9013e8468643344683cf2783f50.zip
VLC: do not restart after exit callback if m_running false
-rw-r--r--src/VLCInput.cpp15
1 files changed, 10 insertions, 5 deletions
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<std::mutex> lock(m_queue_mutex);
+ if (m_running) {
+ std::lock_guard<std::mutex> 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()