Skip to content

Commit

Permalink
Fix crash upon attempting to replay video. (#2162)
Browse files Browse the repository at this point in the history
b/318420573

Change-Id: Icc959ad87aafe10adea0d737984bd6e781e28835
  • Loading branch information
v-kryachko authored Jan 8, 2024
1 parent 92aa069 commit aef8f7b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions starboard/xb1/shared/gpu_base_video_decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -555,11 +555,14 @@ int GpuVideoDecoderBase::OnOutputRetrieved(
{
ScopedLock input_queue_lock(written_inputs_mutex_);
const auto iter = FindByTimestamp(written_inputs_, timestamp);
SB_DCHECK(iter != written_inputs_.cend());
if (is_hdr_video_) {
image->AttachColorMetadata((*iter)->video_stream_info().color_metadata);
// Reset might be called too early, cause clearing of written_inputs_ and
// absence of requested timestamp.
if (iter != written_inputs_.cend()) {
if (is_hdr_video_) {
image->AttachColorMetadata((*iter)->video_stream_info().color_metadata);
}
written_inputs_.erase(iter);
}
written_inputs_.erase(iter);
}
scoped_refptr<VideoFrameImpl> frame(new VideoFrameImpl(
timestamp, std::bind(&GpuVideoDecoderBase::DeleteVideoFrame, this,
Expand Down

0 comments on commit aef8f7b

Please sign in to comment.