From a644414fd2c3a3f7f41e716b6875a78981e4cfe1 Mon Sep 17 00:00:00 2001 From: jacko Date: Fri, 23 Jun 2017 16:12:18 +0200 Subject: adding mpd live handling + automatic mpd fetching Change-Id: I2c05bdf6a4d940ad22bb8632268f4b63a08a80a8 Signed-off-by: jacko --- Common/ViperBuffer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Common/ViperBuffer.cpp') diff --git a/Common/ViperBuffer.cpp b/Common/ViperBuffer.cpp index 27ec8b5e..c59cec04 100644 --- a/Common/ViperBuffer.cpp +++ b/Common/ViperBuffer.cpp @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +#include #include "ViperBuffer.h" ViperBuffer::ViperBuffer(QObject* parent) : QIODevice(parent) @@ -76,17 +76,18 @@ qint64 ViperBuffer::readData(char* data, qint64 maxSize) qint64 ViperBuffer::writeData(libdash::framework::input::MediaObject* media) { pthread_mutex_lock(&(this->monitorMutex)); + int ret = 0; int total = 0; ret = media->ReadInitSegment(readBuffer,readMax); total += ret; this->writeData((const char *)readBuffer, ret); - ret = media->Read(readBuffer,readMax); while(ret) { total += ret; this->writeData((const char *)readBuffer, ret); + ret = media->Read(readBuffer,readMax); } pthread_mutex_unlock(&(this->monitorMutex)); -- cgit 1.2.3-korg