[PROBLEM]
After a decoder reset which happens during seek TimestampHelper value is
reset to std::nullptr. When the very first audio buffer after a reset is
processed, TimestampHelper base time should be set to a value of the
first buffer. However this doesn't happen, because implementation
compares std::nullopt with kNoTimestamp (which is not a nullopt) to
determine whether or not TimestampHelper should be reinitialized with
the buffer time. This causes timestamps of audio buffers to always start
counting from pts = 0 after reset.
[SOLUTION]
Fix code that determines whether or not TimestampHelper should be
reinitialized.
Bug: https://jira-eu.sec.samsung.net/browse/VDWASM-2429
Change-Id: I70219702d4d751a3c9ad5cf3293bfc644df12497
Signed-off-by: Piotr Bałut <p.balut@samsung.com>
// buffers are rejected in |Decode| method.
TIZEN_MEDIA_LOG_ASSERT(buffer->timestamp() != kNoTimestamp);
- const bool first_buffer = timestamp_helper_->base_timestamp() == kNoTimestamp;
+ const bool first_buffer = !timestamp_helper_->base_timestamp().has_value();
if (first_buffer) {
timestamp_helper_->SetBaseTimestamp(buffer->timestamp());
}