From 4ee3bb7e61727af4e87940cc49c2f0c5803343e1 Mon Sep 17 00:00:00 2001 From: Rintaro Kuroiwa Date: Wed, 18 Dec 2013 17:13:41 -0800 Subject: [PATCH] Add 'T' for presentation time Presentation time format is PTS. All seconds to XML duration uses SecondToXmlDuration now. Change-Id: I3afcda9820fc968b35cfb929e0c7de4e2d91f9a2 --- mpd/base/mpd_builder.cc | 5 +++-- mpd/base/mpd_utils.cc | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mpd/base/mpd_builder.cc b/mpd/base/mpd_builder.cc index 5916a28f6a..292340be21 100644 --- a/mpd/base/mpd_builder.cc +++ b/mpd/base/mpd_builder.cc @@ -89,8 +89,9 @@ xmlDocPtr MpdBuilder::GenerateMpd() { "urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd"; mpd.SetStringAttribute("xsi:schemaLocation", kDashSchemaMpd2011); - static const char kMinBufferTimeTwoSeconds[] = "PT2S"; - mpd.SetStringAttribute("minBufferTime", kMinBufferTimeTwoSeconds); + // Currently set to 2. Does this need calculation? + const int kMinBufferTime = 2; + mpd.SetStringAttribute("minBufferTime", SecondsToXmlDuration(kMinBufferTime)); // Iterate thru AdaptationSets and add them to one big Period element. XmlNode period("Period"); diff --git a/mpd/base/mpd_utils.cc b/mpd/base/mpd_utils.cc index f6c5b3d774..deb27ad581 100644 --- a/mpd/base/mpd_utils.cc +++ b/mpd/base/mpd_utils.cc @@ -76,7 +76,7 @@ std::string GetCodecs(const MediaInfo& media_info) { } std::string SecondsToXmlDuration(uint32 seconds) { - return "P" + base::UintToString(seconds) + "S"; + return "PT" + base::UintToString(seconds) + "S"; } bool GetDurationAttribute(xmlNodePtr node, uint32* duration) {