1. MediaPlayerESPlusPlayer should be released before destroyed.
2. WebContents is sometimes destroyed before TizenRendererImpl is destroyed.
It causes TizenRendererImpl accesses dangling pointer.
3. buffering_callback_ in BufferObserverImpl should be null-checked.
Reference:
https://review.tizen.org/gerrit/276393/
Change-Id: I772c80ce9a0f96c5cdc6db6c31aff3465a54eb88
Signed-off-by: Suhaspoornachandra <s.poornachan@samsung.com>
NOTIMPLEMENTED();
}
+void TizenRendererImpl::OnWebContentsDestroyed() {
+ web_contents_observer_ = nullptr;
+}
+
void TizenRendererImpl::OnRendererEnded() {
playback_rate_ = 0.0;
client_->OnEnded();
void InitiateScopedSurfaceRequest(
InitiateScopedSurfaceRequestCallback callback) override;
void OnUpdateAudioMutingState(bool muted) {}
- void OnWebContentsDestroyed() {}
+ void OnWebContentsDestroyed();
// Should be removed.
void Seek(base::TimeDelta time);
void BufferObserverImpl::TriggerStatusChangeCallback(
DemuxerStream::Type type,
BufferStatus status) const {
- buffering_callback_.Run(type, status);
+ if (!buffering_callback_.is_null())
+ buffering_callback_.Run(type, status);
}
BufferStatus BufferObserverImpl::GetBufferStatusFromSize(int buffered_percent) {
MediaPlayerRegistry::GetInstance()->UnregisterMediaPlayer(player_id_);
+ // Player should be released before destroyed.
+ Release();
+
int error = esplusplayer_destroy(esplayer_);
if (error != ESPLUSPLAYER_ERROR_TYPE_NONE)
LOG(ERROR) << "esplusplayer_destroy failed, error #"