return this->mpdManager;
}
-const logic::IAdaptationLogic* DASHManager::getAdaptionLogic() const
+mtime_t DASHManager::getDuration() const
{
- return this->adaptationLogic;
+ if (mpd->isLive())
+ {
+ return 0;
+ }
+ else
+ {
+ const Representation *rep = adaptationLogic->getCurrentRepresentation();
+ if ( !rep )
+ return 0;
+ else
+ return mpd->getDuration() * rep->getBandwidth() / 8;
+ }
}
const Chunk *DASHManager::getCurrentChunk() const
int seekBackwards ( unsigned len );
const mpd::MPDManager* getMpdManager () const;
- const logic::IAdaptationLogic* getAdaptionLogic() const;
+ mtime_t getDuration() const;
const http::Chunk *getCurrentChunk() const;
private:
dash::DASHManager *p_dashManager;
dash::mpd::MPD *p_mpd;
uint64_t position;
- bool isLive;
};
static int Read (stream_t *p_stream, void *p_ptr, unsigned int i_len);
}
p_sys->p_dashManager = p_dashManager;
p_sys->position = 0;
- p_sys->isLive = p_dashManager->getMpdManager()->getMPD()->isLive();
p_stream->p_sys = p_sys;
p_stream->pf_read = Read;
p_stream->pf_peek = Peek;
case STREAM_GET_SIZE:
{
uint64_t* res = (va_arg (args, uint64_t *));
- if(p_sys->isLive)
- *res = 0;
- else
- {
- const dash::mpd::Representation *rep = p_sys->p_dashManager->getAdaptionLogic()->getCurrentRepresentation();
- if ( rep == NULL )
- *res = 0;
- else
- *res = p_sys->p_mpd->getDuration() * rep->getBandwidth() / 8;
- }
+ *res = p_sys->p_dashManager->getDuration();
break;
}
case STREAM_GET_PTS_DELAY: