summaryrefslogtreecommitdiff
path: root/receiver/livereceiver.cpp
diff options
context:
space:
mode:
authorDenis Loh <denis.loh@gmail.com>2009-10-29 16:40:29 +0100
committerDenis Loh <denis.loh@gmail.com>2009-10-29 16:40:29 +0100
commit5057fe1ea036ba681ee232a19392751633322760 (patch)
tree9f28323fd073f8518e90df5148c8737b2ee3017e /receiver/livereceiver.cpp
parenta0ea012e9f0a6535695ab1c6efb6cb700d4b57ef (diff)
downloadvdr-plugin-upnp-5057fe1ea036ba681ee232a19392751633322760.tar.gz
vdr-plugin-upnp-5057fe1ea036ba681ee232a19392751633322760.tar.bz2
Closed bug with ' and database\nimproved LiveTV receiver
Diffstat (limited to 'receiver/livereceiver.cpp')
-rw-r--r--receiver/livereceiver.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/receiver/livereceiver.cpp b/receiver/livereceiver.cpp
index 9ba69eb..189f4a4 100644
--- a/receiver/livereceiver.cpp
+++ b/receiver/livereceiver.cpp
@@ -129,9 +129,10 @@ int cLiveReceiver::read(char* buf, size_t buflen){
if(!this->IsAttached())
bytesRead = -1;
else {
- int WaitTimeout = RECEIVER_WAIT_ON_NODATA_TIMEOUT; // 10 Seconds timeout with no data
- while(!this->mOutputBuffer->Available()){
- WARNING("No data, waiting...");
+ int WaitTimeout = RECEIVER_WAIT_ON_NODATA_TIMEOUT;
+ // Wait until the buffer size is at least half the requested buffer length
+ while((unsigned)this->mOutputBuffer->Available() < (buflen / 2) ){
+ WARNING("Too few data, waiting...");
cCondWait::SleepMs(RECEIVER_WAIT_ON_NODATA);
if(!this->IsAttached()){
MESSAGE("Lost device...");