aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-03-29 17:24:03 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-03-29 17:24:03 +0200
commita20cd53acbeb316c5cbcd7fce79cb2c6032c868a (patch)
treeaaeee5bf3d66c4565a0b3c4c2da82aaa457e0229
parentc5df7ce6c05e6187f4ccf6c8c66f617cbe9c528e (diff)
downloadODR-AudioEnc-a20cd53acbeb316c5cbcd7fce79cb2c6032c868a.tar.gz
ODR-AudioEnc-a20cd53acbeb316c5cbcd7fce79cb2c6032c868a.tar.bz2
ODR-AudioEnc-a20cd53acbeb316c5cbcd7fce79cb2c6032c868a.zip
Allow only opening, buffering and playing VLC states
-rw-r--r--src/VLCInput.cpp5
1 files changed, 4 insertions, 1 deletions
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;
}