Skip to content

Commit

Permalink
Ensure drm manager session are released even if player is null
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaowei-guan committed Jan 9, 2024
1 parent 9649d94 commit b07235a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
1 change: 1 addition & 0 deletions packages/video_player_avplay/tizen/src/drm_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ DrmManager::~DrmManager() {
ReleaseDrmSession();
if (license_request_pipe_) {
ecore_pipe_del(license_request_pipe_);
license_request_pipe_ = nullptr;
}
if (drm_manager_proxy_) {
CloseDrmManagerProxy(drm_manager_proxy_);
Expand Down
18 changes: 6 additions & 12 deletions packages/video_player_avplay/tizen/src/plus_player.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,14 @@ PlusPlayer::PlusPlayer(flutter::BinaryMessenger *messenger,
: VideoPlayer(messenger, flutter_view), video_format_(video_format) {}

PlusPlayer::~PlusPlayer() {
if (!player_) {
LOG_ERROR("[PlusPlayer] Player not created.");
return;
}
if (!Stop(player_)) {
LOG_INFO("[PlusPlayer] Player fail to stop.");
return;
if (player_) {
Stop(player_);
Close(player_);
UnregisterListener(player_);
DestroyPlayer(player_);
player_ = nullptr;
}

Close(player_);
UnregisterListener(player_);
DestroyPlayer(player_);
player_ = nullptr;

if (drm_manager_) {
drm_manager_->ReleaseDrmSession();
}
Expand Down

0 comments on commit b07235a

Please sign in to comment.