[Tizen] If you take the handle, you must be responsible for its destruction. 32/308432/1 accepted/tizen/8.0/unified/20240401.145154
authorjoogab.yun <joogab.yun@samsung.com>
Mon, 25 Mar 2024 09:54:17 +0000 (18:54 +0900)
committerjoogab.yun <joogab.yun@samsung.com>
Mon, 25 Mar 2024 11:14:40 +0000 (20:14 +0900)
Change-Id: Ie980b6d1800e2833c6ef161f3a4957005f704976

dali-extension/video-player/ecore-wl2/tizen-video-player-ecore-wl2.cpp
dali-extension/video-player/ecore-wl2/tizen-video-player.h

index 1a249b9..386cdcf 100755 (executable)
@@ -324,7 +324,8 @@ TizenVideoPlayer::TizenVideoPlayer(Dali::Actor actor, Dali::VideoSyncMode syncMo
   mSyncActor(actor),
   mVideoSizePropertyIndex(Property::INVALID_INDEX),
   mSyncMode(syncMode),
-  mIsInitForSyncMode(false)
+  mIsInitForSyncMode(false),
+  mIsMovedHandle(false)
 {
 }
 
@@ -1206,7 +1207,8 @@ void TizenVideoPlayer::DestroyPlayer()
   int ret = 0;
 
   int error;
-  if(mPlayerState != PLAYER_STATE_NONE)
+  // If user take the handle, user must be responsible for its destruction.
+  if(mPlayerState != PLAYER_STATE_NONE && !mIsMovedHandle)
   {
     GetPlayerState(&mPlayerState);
 
@@ -1227,17 +1229,17 @@ void TizenVideoPlayer::DestroyPlayer()
     {
       DALI_LOG_ERROR("DestroyPlayer, player_destroy() is failed\n");
     }
+  }
 
-    error = sound_manager_destroy_stream_information(mStreamInfo);
-    ret   = LogPlayerError(error);
-    if(ret)
-    {
-      DALI_LOG_ERROR("DestroyPlayer, sound_manager_destroy_stream_information() is failed\n");
-    }
-
-    mPlayerState = PLAYER_STATE_NONE;
-    mPlayer      = NULL;
+  error = sound_manager_destroy_stream_information(mStreamInfo);
+  ret   = LogPlayerError(error);
+  if(ret)
+  {
+    DALI_LOG_ERROR("DestroyPlayer, sound_manager_destroy_stream_information() is failed\n");
   }
+
+  mPlayerState = PLAYER_STATE_NONE;
+  mPlayer      = NULL;
 }
 
 void TizenVideoPlayer::SetCodecType(Dali::VideoPlayerPlugin::CodecType type)
@@ -1339,6 +1341,7 @@ Dali::VideoPlayerPlugin::DisplayMode::Type TizenVideoPlayer::GetDisplayMode() co
 
 Any TizenVideoPlayer::GetMediaPlayer()
 {
+  mIsMovedHandle = true;
   return Any((void*)mPlayer);
 }
 
index ea25d94..03a70b8 100755 (executable)
@@ -313,6 +313,7 @@ private:
   Dali::VideoSyncMode           mSyncMode;
 
   bool mIsInitForSyncMode; ///< the flag for synchronization with video player
+  bool mIsMovedHandle;     ///< the flag for moved the handle
 
 public:
   Dali::VideoPlayerPlugin::VideoPlayerSignalType mFinishedSignal;