From 0170d0530e926040956a95657a498496a9df2204 Mon Sep 17 00:00:00 2001 From: Rintaro Kuroiwa Date: Tue, 28 Jan 2014 16:03:19 -0800 Subject: [PATCH] Add BaseURL before SegmentBase The order affects the output. Even though XML does not care about the order of subelements, it makes more sense for BaseURL element to appear above SegmentBase. Change-Id: Idd1e73446be84640828358ef4d7a74688428f6b5 --- mpd/base/xml/xml_node.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mpd/base/xml/xml_node.cc b/mpd/base/xml/xml_node.cc index cfbc347198..dc07d2fff5 100644 --- a/mpd/base/xml/xml_node.cc +++ b/mpd/base/xml/xml_node.cc @@ -339,6 +339,14 @@ bool RepresentationXmlNode::AddAudioInfo( } bool RepresentationXmlNode::AddVODOnlyInfo(const MediaInfo& media_info) { + if (media_info.has_media_file_name()) { + XmlNode base_url("BaseURL"); + base_url.SetContent(media_info.media_file_name()); + + if (!AddChild(base_url.PassScopedPtr())) + return false; + } + const bool need_segment_base = media_info.has_index_range() || media_info.has_init_range() || media_info.has_reference_time_scale(); @@ -368,14 +376,6 @@ bool RepresentationXmlNode::AddVODOnlyInfo(const MediaInfo& media_info) { return false; } - if (media_info.has_media_file_name()) { - XmlNode base_url("BaseURL"); - base_url.SetContent(media_info.media_file_name()); - - if (!AddChild(base_url.PassScopedPtr())) - return false; - } - if (media_info.has_media_duration_seconds()) { // Adding 'duration' attribute, so that this information can be used when // generating one MPD file. This should be removed from the final MPD.