aboutsummaryrefslogtreecommitdiffstats
path: root/Common/ViperBuffer.cpp
diff options
context:
space:
mode:
authorjacko <jsamain+fdio@cisco.com>2017-06-23 16:12:18 +0200
committerjacko <jsamain+fdio@cisco.com>2017-06-23 16:12:18 +0200
commita644414fd2c3a3f7f41e716b6875a78981e4cfe1 (patch)
tree13fc8ff2f6072add96f987a1a68a15c22d68d911 /Common/ViperBuffer.cpp
parentf8907f0a7a84928800adbbfd8e66e500794aa5d5 (diff)
adding mpd live handling + automatic mpd fetching
Change-Id: I2c05bdf6a4d940ad22bb8632268f4b63a08a80a8 Signed-off-by: jacko <jsamain+fdio@cisco.com>
Diffstat (limited to 'Common/ViperBuffer.cpp')
-rw-r--r--Common/ViperBuffer.cpp5
1 files changed, 3 insertions, 2 deletions
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 <stdio.h>
#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));