void MediaPlayerBridgeCapi::SetVolume(double volume) {
LOG_ID(INFO, player_id_) << "(" << static_cast<void*>(this) << ") "
<< __func__ << " volume: " << volume;
+ volume_ = volume;
if (!IsPrepared()) {
- LOG_ID(ERROR, player_id_) << "Player is not ready.";
+ LOG_ID(ERROR, player_id_) << "Player is not ready, pending set.";
+ pending_set_volume_ = true;
return;
}
if (player_set_volume(player_, volume, volume) != PLAYER_ERROR_NONE)
LOG_ID(ERROR, player_id_) << "|player_set_volume| failed";
-
- volume_ = volume;
}
#if defined(TIZEN_VIDEO_HOLE)
LOG_ID(INFO, player_id_) << "(" << static_cast<void*>(this) << ") "
<< __func__;
if (GetPlayerState() < PLAYER_STATE_READY) {
+ LOG_ID(ERROR, player_id_) << "Invalid state (" << GetPlayerState()
+ << ") change during prepare. Returning.";
return;
}
player_prepared_ = true;
is_preparing_ = false;
+ if (pending_set_volume_) {
+ pending_set_volume_ = false;
+ SetVolume(volume_);
+ }
+
#if defined(TIZEN_VIDEO_HOLE)
if (is_video_hole_)
video_plane_controller_->ApplyDeferredVideoRectIfNeeded();
<< __func__ << " :" << volume;
volume_ = volume;
if (GetPlayerState() == ESPLUSPLAYER_STATE_NONE) {
- LOG_ID(INFO, player_id_) << "(" << static_cast<void*>(this) << ") "
- << __func__ << ", player state is NONE, ignore";
+ LOG_ID(INFO, player_id_)
+ << "(" << static_cast<void*>(this) << ") " << __func__
+ << ", state is NONE, pending set volume.";
+ pending_set_volume_ = true;
return;
}
is_prepared_ = true;
is_preparing_ = false;
+
+ if (pending_set_volume_) {
+ pending_set_volume_ = false;
+ SetVolume(volume_);
+ }
+
if (pending_seek_) {
GetMediaPlayerClient()->OnRequestSeek(pending_seek_position_);
} else if (!is_paused_) {