From c458d21e09d5af3bd9872b1f89237da7fb978842 Mon Sep 17 00:00:00 2001 From: Jacques Samain Date: Thu, 31 Aug 2017 18:29:54 +0200 Subject: Correcting bug that induced skipping of segments in the DL Change-Id: I742ad0782d8e6269d51051ccdf0f44d167b59a35 Signed-off-by: Jacques Samain --- MPD/MPDWrapper.cpp | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/MPD/MPDWrapper.cpp b/MPD/MPDWrapper.cpp index c7bdee9f..3b269a72 100644 --- a/MPD/MPDWrapper.cpp +++ b/MPD/MPDWrapper.cpp @@ -617,33 +617,31 @@ MediaObject* MPDWrapper::getNextSegment (viper::managers::StreamType type, bool else { while((this->isStopping == false) && segmentNumber >= representationStream->getSize()) - { SleepConditionVariableCS(&this->mpdUpdate, &this->monitorMutex, INFINITE); - if(this->isStopping) - { - LeaveCriticalSection(&this->monitorMutex); - return NULL; - } + if(this->isStopping) + { + LeaveCriticalSection(&this->monitorMutex); + return NULL; + } - //Need to update representationStream here as it was updated with the mpd: - switch(type) - { - case viper::managers::StreamType::AUDIO: - representation = this->audioRepresentation; - representations = this->audioRepresentations; - segmentNumber = this->audioSegmentNumber; - break; - case viper::managers::StreamType::VIDEO: - representation = this->videoRepresentation; - representations = this->videoRepresentations; - segmentNumber = this->videoSegmentNumber; - break; - default: - break; - } - representationStream = representations->find(representation)->second; + //Need to update representationStream here as it was updated with the mpd: + switch(type) + { + case viper::managers::StreamType::AUDIO: + representation = this->audioRepresentation; + representations = this->audioRepresentations; + segmentNumber = this->audioSegmentNumber; + break; + case viper::managers::StreamType::VIDEO: + representation = this->videoRepresentation; + representations = this->videoRepresentations; + segmentNumber = this->videoSegmentNumber; + break; + default: + break; } + representationStream = representations->find(representation)->second; } uint64_t segDuration = 0; //Returns the segmentDuration in milliseconds -- cgit 1.2.3-korg