aboutsummaryrefslogtreecommitdiffstats
path: root/UI
diff options
context:
space:
mode:
authorJacques Samain <jsamain+fdio@cisco.com>2017-07-25 15:32:54 +0200
committerJacques Samain <jsamain+fdio@cisco.com>2017-07-25 15:32:54 +0200
commit0e275345e28c34f2c6b91a75f44ac93034ae477c (patch)
tree0b94ec17f395fce7ae1015200d45bd61ce0112a8 /UI
parentce4d018aa8185da0bbf5445eaf54d88700f1a381 (diff)
Handling live MPDs with variable segments duration
Change-Id: I074d8863a9afb47815e47bf663b87e7f663890b9 Signed-off-by: Jacques Samain <jsamain+fdio@cisco.com>
Diffstat (limited to 'UI')
-rw-r--r--UI/DASHPlayerNoGUI.cpp2
-rw-r--r--UI/ViperGui.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/UI/DASHPlayerNoGUI.cpp b/UI/DASHPlayerNoGUI.cpp
index d212b556..2195b88a 100644
--- a/UI/DASHPlayerNoGUI.cpp
+++ b/UI/DASHPlayerNoGUI.cpp
@@ -89,6 +89,8 @@ DASHPlayerNoGUI::DASHPlayerNoGUI(int argc, char ** argv, pthread_cond_t *mainCon
webSocketService.start();
this->parameterAdaptation->segmentDuration = this->mpdWrapper->onFirstDownloadMPD(NULL);
this->multimediaManager->setSegmentDuration(this->parameterAdaptation->segmentDuration);
+ //should be in seconds
+ this->parameterAdaptation->segmentDuration = this->parameterAdaptation->segmentDuration / 1000.0;
this->onStartButtonPressed(0,0,0,0,0);
this->multimediaManager->setLooping(this->repeat);
}
diff --git a/UI/ViperGui.cpp b/UI/ViperGui.cpp
index e23bd308..99d2e5a3 100644
--- a/UI/ViperGui.cpp
+++ b/UI/ViperGui.cpp
@@ -192,7 +192,7 @@ void ViperGui::writeData(libdash::framework::input::MediaObject* media)
this->segment = this->segment + 1;
if( this->segment > 0)
{
- this->bufferDuration += this->segmentDuration;
+ this->bufferDuration += media->GetSegmentDuration();
if(this->bufferDuration - this->position > 3000)
{
@@ -206,7 +206,7 @@ void ViperGui::writeData(libdash::framework::input::MediaObject* media)
}
else
{
- this->bufferDuration += (this->durationMilliseconds - (this->segmentDuration * (this->listSegmentSize - 1)));
+ this->bufferDuration += (this->durationMilliseconds - (media->GetSegmentDuration() * (this->listSegmentSize - 1)));
if(this->bufferDuration - this->position >3000)
{