Skip to content

Commit

Permalink
[media] Refine write_head_ handling in ChunkDemuxer (#3246)
Browse files Browse the repository at this point in the history
Only check timestamps for non-EOS DecoderBuffer instances, as timestamps
on EOS buffers are invalid.

b/339529355

Change-Id: Id2a9434f93cd34ca37869c6167af7a4f9c775507
  • Loading branch information
xiaomings committed May 15, 2024
1 parent e0c7808 commit c234cf2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion media/filters/chunk_demuxer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,11 @@ void ChunkDemuxerStream::CompletePendingReadIfPossible_Locked() {
DCHECK(!buffers.empty());
requested_buffer_count_ = 0;
#if defined(STARBOARD)
write_head_ = std::max(write_head_, buffers.back()->timestamp());
for (auto&& buffer : buffers) {
if (!buffer->end_of_stream()) {
write_head_ = std::max(write_head_, buffer->timestamp());
}
}
#endif // defined(STARBOARD)
std::move(read_cb_).Run(kOk, std::move(buffers));
}
Expand Down

0 comments on commit c234cf2

Please sign in to comment.