Ignore OnReadyToSeek after function Release 77/316377/3
authorzhishun.zhou <zhishun.zhou@samsung.com>
Tue, 20 Aug 2024 10:48:21 +0000 (18:48 +0800)
committerzhishun zhou <zhishun.zhou@samsung.com>
Tue, 20 Aug 2024 10:39:57 +0000 (10:39 +0000)
There is a PostTask in MediaPlayerESPlusPlayer::OnReadyToSeek,
if the posted task comes after MediaPlayerESPlusPlayer::Release(),
the loop of ReadBuffer will be retriggered in suspending state.
Let's ignore OnReadyToSeek after function Release.

Change-Id: I2a0005c125b4b70e286350334309af805954faa9
Signed-off-by: zhishun.zhou <zhishun.zhou@samsung.com>
tizen_src/chromium_impl/media/filters/media_player_esplusplayer.cc

index e0ddbc7a9c746e4a8df0779cefbb4a582701c104..45d76536f24ed743bde42aa5078428d2ade5b564 100644 (file)
@@ -1382,6 +1382,8 @@ void MediaPlayerESPlusPlayer::OnFlushComplete() {
 void MediaPlayerESPlusPlayer::OnReadyToSeek(
     const esplusplayer_stream_type stream_type,
     const uint64_t seek_time) {
+  LOG_ID(INFO, player_id_) << "(" << static_cast<void*>(this) << ") "
+                           << __func__;
   if (!task_runner_->BelongsToCurrentThread()) {
     task_runner_->PostTask(
         FROM_HERE,
@@ -1400,6 +1402,13 @@ void MediaPlayerESPlusPlayer::OnReadyToSeek(
     return;
   }
 
+  // Ignore OnReadyToSeek in release state
+  if (GetPlayerState() == ESPLUSPLAYER_STATE_NONE) {
+    LOG_ID(INFO, player_id_)
+        << __func__ << " Ignore OnReadyToSeek after function Release().";
+    return;
+  }
+
   SetShouldFeed(GetDemuxerStreamType(stream_type), true);
   SetIsEos(GetDemuxerStreamType(stream_type), false);
   ReadBuffer(GetDemuxerStreamType(stream_type));