[TTVD] Fixed incorrect audio timestamp after seek 33/324933/3
authorPiotr Bałut <p.balut@samsung.com>
Thu, 22 May 2025 12:18:28 +0000 (14:18 +0200)
committerBot Blink <blinkbot@samsung.com>
Thu, 29 May 2025 10:14:51 +0000 (10:14 +0000)
[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>
media/filters/tizen/ttvd_audio_decoder_impl.cc

index 8815eb35ed7a15c3d28735faef89225a1b4c9a50..0938ba7fe86ada558357e6bd9edd6e968044f22b 100644 (file)
@@ -581,7 +581,7 @@ void TTvdAudioDecoderImpl::HandleDecodingRequest(
   // 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());
   }