Skip to content

Commit

Permalink
Reset stream reading status on abort (#4390)
Browse files Browse the repository at this point in the history
Reset |audio/video_read_in_progress_| when demuxer read request aborted,
so that quick consecutive seeks won't hang the player.

b/377522209
  • Loading branch information
jasonzhangxx authored Nov 7, 2024
1 parent d25ae29 commit f47f387
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions media/starboard/starboard_renderer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,18 @@ void StarboardRenderer::OnDemuxerStreamRead(
player_bridge_->WriteBuffers(DemuxerStream::VIDEO, buffers);
}
} else if (status == DemuxerStream::kAborted) {
if (stream == audio_stream_) {
DCHECK(audio_read_in_progress_);
audio_read_in_progress_ = false;
}
if (stream == video_stream_) {
DCHECK(video_read_in_progress_);
video_read_in_progress_ = false;
}
if (pending_flush_cb_ && !audio_read_in_progress_ &&
!video_read_in_progress_) {
std::move(pending_flush_cb_).Run();
}
} else if (status == DemuxerStream::kConfigChanged) {
if (stream == audio_stream_) {
client_->OnAudioConfigChange(stream->audio_decoder_config());
Expand Down

0 comments on commit f47f387

Please sign in to comment.