diff options
-rw-r--r-- | src/VLCInput.cpp | 11 | ||||
-rw-r--r-- | src/dabplus-enc.cpp | 1 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/VLCInput.cpp b/src/VLCInput.cpp index 4141535..e2dd5a8 100644 --- a/src/VLCInput.cpp +++ b/src/VLCInput.cpp @@ -111,10 +111,7 @@ int VLCInput::prepare() libvlc_media_release(m); // Start playing - libvlc_media_player_play(m_mp); - - fprintf(stderr, "VLC launched.\n"); - return 0; + return libvlc_media_player_play(m_mp); } void VLCInput::preRender_cb(uint8_t** pp_pcm_buffer, size_t size) @@ -196,6 +193,12 @@ ssize_t VLCInput::m_read(uint8_t* buf, size_t length) lock.unlock(); boost::this_thread::sleep(boost::posix_time::milliseconds(1)); + + libvlc_media_t *media = libvlc_media_player_get_media(m_mp); + if (libvlc_media_get_state(media) == libvlc_Error) { + err = -1; + break; + } } return err; } diff --git a/src/dabplus-enc.cpp b/src/dabplus-enc.cpp index 9e8bd00..806f68b 100644 --- a/src/dabplus-enc.cpp +++ b/src/dabplus-enc.cpp @@ -723,6 +723,7 @@ int main(int argc, char *argv[]) #if HAVE_VLC else if (vlc_uri != "") { read = vlc_in.read(input_buf, input_size); + fprintf(stderr, "Detected fault in VLC input!\n"); if (read < 0) { break; } |