Skip to content

Commit

Permalink
Cherry pick PR #3246: [media] Refine write_head_ handling in ChunkDem…
Browse files Browse the repository at this point in the history
…uxerStream (#3264)

Refer to the original PR: #3246

Only check timestamps for non-EOS DecoderBuffer instances, as timestamps
on EOS buffers are invalid.

b/339529355

Change-Id: Id2a9434f93cd34ca37869c6167af7a4f9c775507

Co-authored-by: xiaomings <[email protected]>
  • Loading branch information
cobalt-github-releaser-bot and xiaomings authored May 15, 2024
1 parent 47f6e86 commit 13e6c62
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 13e6c62

Please sign in to comment.