From a20cd53acbeb316c5cbcd7fce79cb2c6032c868a Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sun, 29 Mar 2015 17:24:03 +0200 Subject: Allow only opening, buffering and playing VLC states --- src/VLCInput.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/VLCInput.cpp') diff --git a/src/VLCInput.cpp b/src/VLCInput.cpp index e2dd5a8..c4c0413 100644 --- a/src/VLCInput.cpp +++ b/src/VLCInput.cpp @@ -195,7 +195,10 @@ ssize_t VLCInput::m_read(uint8_t* buf, size_t length) 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) { + libvlc_state_t st = libvlc_media_get_state(media); + if (!(st == libvlc_Opening || + st == libvlc_Buffering || + st == libvlc_Playing) ) { err = -1; break; } -- cgit v1.2.3