bool is_video_hole_ = false;
bool is_video_low_latency_ = false;
int player_id_ = 0;
+ bool is_paused_ = true;
// first -> pts, second -> duration
base::StaticMap<DemuxerStream::Type,
std::pair<base::TimeDelta, base::TimeDelta>,
double pending_playback_rate_ = 0.0;
bool is_prepared_ = false;
bool is_preparing_ = false;
- bool is_paused_ = true;
bool is_buffering_ = false;
base::TimeDelta current_position_;
auto dec_name = content::kNoneDecoder;
if (td_ptr) {
dec_name = td_ptr->GetDecoderType();
- SetDecoderAcquired(td_ptr->GetDecoderType());
+ if (!td_ptr->IsOwnerTheSame(content::DecoderOwner(this))) {
+ bool media_resource_acquired = false;
+ GetMediaPlayerClient()->NotifyPlaybackState(
+ kPlaybackVideoReady, GetPlayerId(), "", "", &media_resource_acquired,
+ NULL, NULL, dec_name);
+ if (!media_resource_acquired) {
+ LOG_ID(INFO, GetPlayerId()) << "HbbTV media resource was not acquired";
+ } else {
+ SetDecoderAcquired(td_ptr->GetDecoderType());
+ MediaPlayerESPlusPlayer::Prepare();
+ // Clear is_paused_ so that playback will start when prepare completes
+ is_paused_ = false;
+ }
+ return false;
+ }
}
if (GetMediaPlayerClient()) {
bool media_resource_acquired = false;
ChooseDecoderIfNeeded(video_config.codec());
if (auto td_ptr = suitable_decoder_.lock()) {
decoder_assigned_ = true;
+ if (td_ptr->IsOwnerTheSame(content::DecoderOwner(this))) {
+ // Decoder resource is acquired, we can prepare the player
+ MediaPlayerESPlusPlayer::Prepare();
+ }
}
}
}
- MediaPlayerESPlusPlayer::Prepare();
}
void MediaPlayerESPlusPlayerTV::Release() {