Skip to content

Commit

Permalink
Avoid triggering DCHECK() on playback end (#4620)
Browse files Browse the repository at this point in the history
Calling DecoderBuffer::timestamp() on end of stream buffers triggers
DCHECK(). Now EOS buffers are explicitly checked for before calling
timestamp() in StarboardRenderer::OnDemuxerStreamRead(), to avoid a
DCHECK() triggered in Devel build when playback finishes.

b/326652276
  • Loading branch information
xiaomings authored Dec 20, 2024
1 parent 3a76d1e commit 4cc5341
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions media/starboard/starboard_renderer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -592,9 +592,11 @@ void StarboardRenderer::OnDemuxerStreamRead(
DCHECK(audio_read_in_progress_);
audio_read_in_progress_ = false;
for (const auto& buffer : buffers) {
last_audio_sample_interval_ =
buffer->timestamp() - timestamp_of_last_written_audio_;
timestamp_of_last_written_audio_ = buffer->timestamp();
if (!buffer->end_of_stream()) {
last_audio_sample_interval_ =
buffer->timestamp() - timestamp_of_last_written_audio_;
timestamp_of_last_written_audio_ = buffer->timestamp();
}
}
player_bridge_->WriteBuffers(DemuxerStream::AUDIO, buffers);
} else {
Expand Down

0 comments on commit 4cc5341

Please sign in to comment.