diff --git a/packager/media/base/text_sample.cc b/packager/media/base/text_sample.cc index 9effc25357..871126b497 100644 --- a/packager/media/base/text_sample.cc +++ b/packager/media/base/text_sample.cc @@ -21,6 +21,13 @@ void TextSample::SetTime(uint64_t start_time, uint64_t end_time) { duration_ = end_time - start_time; } +void TextSample::AppendStyle(const std::string& style) { + if (settings_.length()) { + settings_ += " "; + } + settings_ += style; +} + void TextSample::AppendPayload(const std::string& payload) { if (payload_.length()) { payload_ += "\n"; diff --git a/packager/media/base/text_sample.h b/packager/media/base/text_sample.h index 330851e9d4..db8b94aa04 100644 --- a/packager/media/base/text_sample.h +++ b/packager/media/base/text_sample.h @@ -26,8 +26,8 @@ class TextSample { uint64_t EndTime() const; void set_id(const std::string& id) { id_ = id; } - void set_settings(const std::string& settings) { settings_ = settings; } void SetTime(uint64_t start_time, uint64_t end_time); + void AppendStyle(const std::string& style); void AppendPayload(const std::string& payload); private: