diff options
Diffstat (limited to 'libdash/source/mpd/SegmentTemplate.cpp')
-rw-r--r-- | libdash/source/mpd/SegmentTemplate.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libdash/source/mpd/SegmentTemplate.cpp b/libdash/source/mpd/SegmentTemplate.cpp index b92c4692..f64f58c1 100644 --- a/libdash/source/mpd/SegmentTemplate.cpp +++ b/libdash/source/mpd/SegmentTemplate.cpp @@ -73,15 +73,15 @@ ISegment* SegmentTemplate::GetIndexSegmentFromNumber (const std:: { return ToSegment(this->index, baseurls, representationID, bandwidth, dash::metrics::IndexSegment, number); } -ISegment* SegmentTemplate::GetMediaSegmentFromTime (const std::vector<IBaseUrl *>& baseurls, const std::string& representationID, uint32_t bandwidth, uint32_t time) const +ISegment* SegmentTemplate::GetMediaSegmentFromTime (const std::vector<IBaseUrl *>& baseurls, const std::string& representationID, uint32_t bandwidth, uint64_t time) const { return ToSegment(this->media, baseurls, representationID, bandwidth, dash::metrics::MediaSegment, 0, time); } -ISegment* SegmentTemplate::GetIndexSegmentFromTime (const std::vector<IBaseUrl *>& baseurls, const std::string& representationID, uint32_t bandwidth, uint32_t time) const +ISegment* SegmentTemplate::GetIndexSegmentFromTime (const std::vector<IBaseUrl *>& baseurls, const std::string& representationID, uint32_t bandwidth, uint64_t time) const { return ToSegment(this->index, baseurls, representationID, bandwidth, dash::metrics::IndexSegment, 0, time); } -std::string SegmentTemplate::ReplaceParameters (const std::string& uri, const std::string& representationID, uint32_t bandwidth, uint32_t number, uint32_t time) const +std::string SegmentTemplate::ReplaceParameters (const std::string& uri, const std::string& representationID, uint32_t bandwidth, uint32_t number, uint64_t time) const { std::vector<std::string> chunks; std::string replacedUri = ""; @@ -127,19 +127,18 @@ std::string SegmentTemplate::ReplaceParameters (const std:: return replacedUri; } } -void SegmentTemplate::FormatChunk (std::string& uri, uint32_t number) const +void SegmentTemplate::FormatChunk (std::string& uri, uint64_t number) const { char formattedNumber [50]; size_t pos = 0; - std::string formatTag = "%01d"; + std::string formatTag = "%01lu"; if ( (pos = uri.find("%0")) != std::string::npos) formatTag = uri.substr(pos).append("d"); - sprintf(formattedNumber, formatTag.c_str(), number); uri = formattedNumber; } -ISegment* SegmentTemplate::ToSegment (const std::string& uri, const std::vector<IBaseUrl *>& baseurls, const std::string& representationID, uint32_t bandwidth, HTTPTransactionType type, uint32_t number, uint32_t time) const +ISegment* SegmentTemplate::ToSegment (const std::string& uri, const std::vector<IBaseUrl *>& baseurls, const std::string& representationID, uint32_t bandwidth, HTTPTransactionType type, uint32_t number, uint64_t time) const { Segment *seg = new Segment(); @@ -149,4 +148,4 @@ ISegment* SegmentTemplate::ToSegment (const std:: delete(seg); return NULL; -}
\ No newline at end of file +} |