As discussed in https://github.com/WebKit/WebKit/pull/11599 If wee append the following: "init_segment | media_segment | init_segment Our handling of such scenario is problematic and would result in an undefined behaviour, in particular in regards to track ID ; it is possible for track id to change in between run, even get swapped between audio and video (we even have a test about it: as it used to cause a crash). We currently wait for the init segment to finish being processed by the SourceBuffer running in the content process; however if we immediately have a 2nd init segment, we will process the demuxed samples only after we've finished handling the 2nd init segment. We should process the demuxed samples once the init segment they immediately follow has been processed and only start to check the 2nd init segment then.
<rdar://problem/106859839>
Once done, we could add an ASSERT(!m_appendCompletedPending) in SourceBufferPrivate::appendCompleted() in the `if (processingInitializationSegment())` block.
Pull request: https://github.com/WebKit/WebKit/pull/12044
Committed 262300@main (f820f4ae8567): <https://commits.webkit.org/262300@main> Reviewed commits have been landed. Closing PR #12044 and removing active labels.