diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-10-07 13:18:13 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-10-07 13:22:31 +0200 |
commit | 2e04e80966d435f4e0c5f472d501b45ec52aba33 (patch) | |
tree | e6e4fbc484f2076df1135ed2262fd4d091e26e6e /src/VLCInput.cpp | |
parent | 274c56665d98a392b4488b5cbe4bf7206181c5fc (diff) | |
download | ODR-AudioEnc-2e04e80966d435f4e0c5f472d501b45ec52aba33.tar.gz ODR-AudioEnc-2e04e80966d435f4e0c5f472d501b45ec52aba33.tar.bz2 ODR-AudioEnc-2e04e80966d435f4e0c5f472d501b45ec52aba33.zip |
Add -R option to restart input on fault
Diffstat (limited to 'src/VLCInput.cpp')
-rw-r--r-- | src/VLCInput.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/VLCInput.cpp b/src/VLCInput.cpp index 494d620..837d94f 100644 --- a/src/VLCInput.cpp +++ b/src/VLCInput.cpp @@ -122,6 +122,17 @@ void handleVLCExit(void* opaque) ((VLCInput*)opaque)->exit_cb(); } +VLCInput::~VLCInput() +{ + m_running = false; + + if (m_thread.joinable()) { + m_thread.join(); + } + + cleanup(); +} + void VLCInput::prepare() { if (m_fault) { @@ -300,7 +311,7 @@ void VLCInput::cleanup() if (m_vlc) { libvlc_release(m_vlc); - m_vlc = NULL; + m_vlc = nullptr; } } @@ -520,7 +531,7 @@ vlc_data_type_e check_vlc_uses_size_t() if (major_ver_sz) { int major_ver = atoi(major_ver_sz); - char *minor_ver_sz = strtok_r(NULL, ".", &saveptr); + char *minor_ver_sz = strtok_r(nullptr, ".", &saveptr); if (minor_ver_sz) { int minor_ver = atoi(minor_ver_sz); |