From 4e9aadcb15550d4268a8b31405a08a7bff61eeb9 Mon Sep 17 00:00:00 2001 From: KongQun Yang Date: Fri, 16 Mar 2018 18:47:25 -0700 Subject: [PATCH] Write @startNumber for SegmentTemplate with $Time$ too Change-Id: I8d55d81e7114e02b511656e73ecc0ad3bb1aa74f --- packager/mpd/base/representation_unittest.cc | 7 ++++--- packager/mpd/base/xml/xml_node.cc | 8 +------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/packager/mpd/base/representation_unittest.cc b/packager/mpd/base/representation_unittest.cc index d2656677ce..92cf52488f 100644 --- a/packager/mpd/base/representation_unittest.cc +++ b/packager/mpd/base/representation_unittest.cc @@ -458,7 +458,8 @@ class SegmentTemplateTest : public RepresentationTest { " codecs=\"avc1.010101\" mimeType=\"video/mp4\" sar=\"1:1\" " " width=\"720\" height=\"480\" frameRate=\"10/5\">\n" " \n" + " initialization=\"init.mp4\" media=\"$Time$.mp4\" " + " startNumber=\"1\">\n" " \n" " %s\n" " \n" @@ -486,7 +487,7 @@ TEST_F(SegmentTemplateTest, OneSegmentNormal) { " codecs=\"avc1.010101\" mimeType=\"video/mp4\" sar=\"1:1\" " " width=\"720\" height=\"480\" frameRate=\"10/5\">\n" " \n" + " initialization=\"init.mp4\" media=\"$Time$.mp4\" startNumber=\"1\">\n" " \n" " \n" " \n" @@ -539,7 +540,7 @@ TEST_F(SegmentTemplateTest, PresentationTimeOffset) { " width=\"720\" height=\"480\" frameRate=\"10/5\">\n" // pto = kPresentationTimeOffsetSeconds * timescale + FLAGS_pto_adjustment " \n" + " initialization=\"init.mp4\" media=\"$Time$.mp4\" startNumber=\"1\">\n" " \n" " \n" " \n" diff --git a/packager/mpd/base/xml/xml_node.cc b/packager/mpd/base/xml/xml_node.cc index 2148c743e7..a7a947c13a 100644 --- a/packager/mpd/base/xml/xml_node.cc +++ b/packager/mpd/base/xml/xml_node.cc @@ -354,13 +354,7 @@ bool RepresentationXmlNode::AddLiveOnlyInfo( if (media_info.has_segment_template()) { segment_template.SetStringAttribute("media", media_info.segment_template()); - - // TODO(rkuroiwa): Need a better check. $$Number is legitimate but not a - // template. - if (media_info.segment_template().find("$Number") != std::string::npos) { - DCHECK_GE(start_number, 1u); - segment_template.SetIntegerAttribute("startNumber", start_number); - } + segment_template.SetIntegerAttribute("startNumber", start_number); } // TODO(rkuroiwa): Find out when a live MPD doesn't require SegmentTimeline.