aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacques Samain <jsamain+fdio@cisco.com>2017-08-31 18:29:54 +0200
committerJacques Samain <jsamain+fdio@cisco.com>2017-08-31 18:29:54 +0200
commitc458d21e09d5af3bd9872b1f89237da7fb978842 (patch)
treeceac2c914d86f3712da0ab332bb7988165f6a180
parent85108e392f499bd1b4c39d073c009986007e95df (diff)
Correcting bug that induced skipping of segments in the DL
Change-Id: I742ad0782d8e6269d51051ccdf0f44d167b59a35 Signed-off-by: Jacques Samain <jsamain+fdio@cisco.com>
-rw-r--r--MPD/MPDWrapper.cpp44
1 files 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