Skip to content

Commit

Permalink
[MPD] check MPS::type==dynamic for LIVE streams
Browse files Browse the repository at this point in the history
  • Loading branch information
peak3d committed Jul 5, 2018
1 parent 16a4043 commit aa6c3f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/main.cpp
Expand Up @@ -1851,7 +1851,10 @@ bool Session::initialize()
kodi::Log(ADDON_LOG_ERROR, "Could not open / parse mpdURL (%s)", mpdFileURL_.c_str());
return false;
}
kodi::Log(ADDON_LOG_INFO, "Successfully parsed .mpd file. #Streams: %d Download speed: %0.4f Bytes/s", adaptiveTree_->periods_[0]->adaptationSets_.size(), adaptiveTree_->download_speed_);
kodi::Log(ADDON_LOG_INFO, "Successfully parsed .mpd file. #Streams: %d Type: %s, Download speed: %0.4f Bytes/s",
adaptiveTree_->periods_[0]->adaptationSets_.size(),
adaptiveTree_->has_timeshift_buffer_ ? "live" : "VOD",
adaptiveTree_->download_speed_);

if (adaptiveTree_->encryptionState_ == adaptive::AdaptiveTree::ENCRYTIONSTATE_ENCRYPTED)
{
Expand Down
6 changes: 4 additions & 2 deletions src/parser/DASHTree.cpp
Expand Up @@ -854,7 +854,10 @@ start(void *data, const char *el, const char **attr)
for (; *attr;)
{
if (strcmp((const char*)*attr, "mediaPresentationDuration") == 0)
{
mpt = (const char*)*(attr + 1);
bStatic = true;
}
else if (strcmp((const char*)*attr, "type") == 0)
{
bStatic = strcmp((const char*)*(attr + 1), "static") == 0;
Expand Down Expand Up @@ -886,8 +889,7 @@ start(void *data, const char *el, const char **attr)

if (!mpt)
mpt = tsbd;
else if (bStatic)
dash->has_timeshift_buffer_ = false;
dash->has_timeshift_buffer_ = !bStatic;

AddDuration(mpt, dash->overallSeconds_, 1);

Expand Down

0 comments on commit aa6c3f4

Please sign in to comment.