Skip to content

Commit 29018cb

Browse files
authored
[media] Remove GetWriteHead NOTREACHED (#6808)
This change removes the `NOTREACHED` in `ChunkDemuxer::GetWriteHead()` as the web app may call the function before `|id_to_mime_map_|` is populated. Now the Devel and Debug builds handle this case in the same way as QA and Gold by returning a default `TimeDelta`. Bug: 431850940
1 parent 64153cb commit 29018cb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

media/filters/chunk_demuxer.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,8 +1075,11 @@ base::TimeDelta ChunkDemuxer::GetWriteHead(const std::string& id) const {
10751075

10761076
auto iter = id_to_streams_map_.find(id);
10771077
if (iter == id_to_streams_map_.end() || iter->second.empty()) {
1078-
// Handled just in case.
1079-
NOTREACHED();
1078+
// This function may rarely execute before |id| has been inserted into
1079+
// |id_to_streams_map_|. Return a default TimeDelta in this case.
1080+
MEDIA_LOG(ERROR, media_log_)
1081+
<< "Attempted to access the write head of SourceBuffer " << id
1082+
<< " before it's been fully initialized.";
10801083
return base::TimeDelta();
10811084
}
10821085

0 commit comments

Comments
 (0)