diff options
Diffstat (limited to 'Input')
-rw-r--r-- | Input/DASHReceiver.cpp | 26 | ||||
-rw-r--r-- | Input/ICNConnectionConsumerApi.cpp | 3 |
2 files changed, 15 insertions, 14 deletions
diff --git a/Input/DASHReceiver.cpp b/Input/DASHReceiver.cpp index df9d019b..bbfe3e35 100644 --- a/Input/DASHReceiver.cpp +++ b/Input/DASHReceiver.cpp @@ -55,6 +55,7 @@ DASHReceiver::DASHReceiver (IMPD *mpd, IDASHReceiverObserver *obs, Buff this->adaptationSetStream = new AdaptationSetStream(mpd, period, adaptationSet); this->representationStream = adaptationSetStream->getRepresentationStream(this->representation); this->segmentOffset = CalculateSegmentOffset(); + this->representationStream->setSegmentOffset(this->segmentOffset); this->conn = NULL; this->initConn = NULL; @@ -131,20 +132,23 @@ MediaObject* DASHReceiver::GetNextSegment () while(this->isPaused) SleepConditionVariableCS(&this->paused, &this->monitorPausedMutex, INFINITE); - if(this->segmentNumber >= this->representationStream->getSize()) + if(!strcmp(this->mpd->GetType().c_str(), "static")) { - qDebug("looping? : %s\n", this->isLooping ? "YES" : "NO"); - if(this->isLooping) + if(this->segmentNumber >= this->representationStream->getSize()) { - this->segmentNumber = 0; - } - else - { - LeaveCriticalSection(&this->monitorPausedMutex); - return NULL; + qDebug("looping? : %s\n", this->isLooping ? "YES" : "NO"); + if(this->isLooping) + { + this->segmentNumber = 0; + } + else + { + LeaveCriticalSection(&this->monitorPausedMutex); + return NULL; + } } } - seg = this->representationStream->getMediaSegment(this->segmentNumber + this->segmentOffset); + seg = this->representationStream->getMediaSegment(this->segmentNumber); if (seg != NULL) { @@ -167,7 +171,7 @@ MediaObject* DASHReceiver::GetSegment (uint32_t segNum) if(segNum >= this->representationStream->getSize()) return NULL; - seg = this->representationStream->getMediaSegment(segNum + segmentOffset); + seg = this->representationStream->getMediaSegment(segNum); if (seg != NULL) { diff --git a/Input/ICNConnectionConsumerApi.cpp b/Input/ICNConnectionConsumerApi.cpp index 62e9ecdf..8f28e5ce 100644 --- a/Input/ICNConnectionConsumerApi.cpp +++ b/Input/ICNConnectionConsumerApi.cpp @@ -112,7 +112,6 @@ void ICNConnectionConsumerApi::InitForMPD(const std::string& url) { m_first = 1; sizeDownloaded = 0; - printf("initmpd %s\n", url.c_str()); m_name = url; m_isFinished = false; @@ -120,7 +119,6 @@ void ICNConnectionConsumerApi::InitForMPD(const std::string& url) dataPos = 0; datSize = 0; - printf("initiated for mpd\n"); Debug("ICN_Connection:\tINTIATED_for_mpd %s\n", m_name.c_str()); } @@ -147,7 +145,6 @@ int ICNConnectionConsumerApi::Read(uint8_t *data, size_t len) return len; } else { - printf("minore uguale\n"); memcpy(data, (char*)response.data() + this->dataPos, response.size() - this->dataPos); int length = response.size() - this->dataPos; if (length == 0) |