Seen in a few EWS run https://build.webkit.org/results/Apple-Ventura-Debug-WK2-Tests/271159@main%20(3493)/media/media-source/media-source-first-sample-pts-non-zero-canplay-without-renderer-crash-log.txt ``` 0 com.apple.JavaScriptCore 0x10be3e41e WTFCrash 1 com.apple.JavaScriptCore 0x10be604d2 ReportBlockedObjCException(NSException*) 2 com.apple.WebCore 0x19e8f2e8c WebCore::SourceBufferParserAVFObjC::setShouldProvideMediaDataForTrackID(bool, unsigned long long) 3 com.apple.WebCore 0x19e908d90 WebCore::SourceBufferPrivateAVFObjC::trackDidChangeSelected(WebCore::VideoTrackPrivate&, bool) 4 com.apple.WebCore 0x19e926ef2 WebCore::SourceBufferPrivateAVFObjC::setTrackChangeCallbacks(WebCore::SourceBufferPrivateClient::InitializationSegment const&, bool)::$_9::operator()(WebCore::VideoTrackPrivate&, bool)::'lambda'()::operator()() const 5 com.apple.WebCore 0x19e926c68 WTF::Detail::CallableWrapper<WebCore::SourceBufferPrivateAVFObjC::setTrackChangeCallbacks(WebCore::SourceBufferPrivateClient::InitializationSegment const&, bool)::$_9::operator()(WebCore::VideoTrackPrivate&, bool)::'lambda'(), void>::call() 6 com.apple.WebCore 0x19e36d3a2 WTF::Function<void ()>::operator()() const 7 com.apple.WebCore 0x19e903f7e WebCore::SourceBufferPrivateAVFObjC::processInitialisationSegment(std::__1::optional<WebCore::SourceBufferPrivateClient::InitializationSegment>&&) 8 com.apple.WebCore 0x1a320f0ea auto WebCore::SourceBufferPrivate::didReceiveInitializationSegment(WebCore::SourceBufferPrivateClient::InitializationSegment&&)::$_13::operator()<std::experimental::fundamentals_v3::expected<void, WebCore::PlatformMediaError>>(std::experimental::fundamentals_v3::expected<void, WebCore::PlatformMediaError>) 9 com.apple.WebCore 0x1a320efe2 decltype(std::declval<WebCore::SourceBufferPrivate::didReceiveInitializationSegment(WebCore::SourceBufferPrivateClient::InitializationSegment&&)::$_13>()(std::declval<std::experimental::fundamentals_v3::expected<void, WebCore::PlatformMediaError>>())) std::__1::__invoke[abi:v15006]<WebCore::SourceBufferPrivate::didReceiveInitializationSegment(WebCore::SourceBufferPrivateClient::InitializationSegment&&)::$_13, std::experimental::fundamentals_v3::expected<void, WebCore::PlatformMediaError>>(WebCore::SourceBufferPrivate::didReceiveInitializationSegment(WebCore::SourceBufferPrivateClient::InitializationSegment&&)::$_13&&, std::experimental::fundamentals_v3::expected<void, WebCore::PlatformMediaError>&&) 10 com.apple.WebCore 0x1a320ef98 std::__1::invoke_result<WebCore::SourceBufferPrivate::didReceiveInitializationSegment(WebCore::SourceBufferPrivateClient::InitializationSegment&&)::$_13, std::experimental::fundamentals_v3::expected<void, WebCore::PlatformMediaError>>::type std::__1::invoke<WebCore::SourceBufferPrivate::didReceiveInitializationSegment(WebCore::SourceBufferPrivateClient::InitializationSegment&&)::$_13, std::experimental::fundamentals_v3::expected<void, WebCore::PlatformMediaError>>(WebCore::SourceBufferPrivate::didReceiveInitializationSegment(WebCore::SourceBufferPrivateClient::InitializationSegment&&)::$_13&&, std::experimental::fundamentals_v3::expected<void, WebCore::PlatformMediaError>&&) 11 com.apple.WebCore 0x1a320ef58 auto WTF::NativePromise<void, WebCore::PlatformMediaError, 0u>::invokeWithVoidOrWithArg<WebCore::SourceBufferPrivate::didReceiveInitializationSegment(WebCore::SourceBufferPrivateClient::InitializationSegment&&)::$_13, std::experimental::fundamentals_v3::expected<void, WebCore::PlatformMediaError>>(WebCore::SourceBufferPrivate::didReceiveInitializationSegment(WebCore::SourceBufferPrivateClient::InitializationSegment&&)::$_13&&, std::experimental::fundamentals_v3::expected<void, WebCore::PlatformMediaError>&&) 12 com.apple.WebCore 0x1a320ef20 auto WTF::NativePromise<void, WebCore::PlatformMediaError, 0u>::whenSettled<WTF::RunLoop, WebCore::SourceBufferPrivate::didReceiveInitializationSegment(WebCore::SourceBufferPrivateClient::InitializationSegment&&)::$_13>(WTF::RunLoop&, WebCore::SourceBufferPrivate::didReceiveInitializationSegment(WebCore::SourceBufferPrivateClient::InitializationSegment&&)::$_13&&, WTF::Logger::LogSiteIdentifier const&)::'lambda'(std::experimental::fundamentals_v3::expected<void, WebCore::PlatformMediaError>&&)::operator()('lambda'(std::experimental::fundamentals_v3::expected<void, WebCore::PlatformMediaError>&&)) ``` When an init segment is received, and after it's been sent back to the content process to build the Audio/Video TrackBufferList , the SourceBufferPrivateObjC calls `[m_parser setShouldProvideMediaData:]` on the main thread. However, m_parser needs to be operating on the parsing queue and could be in the middle of processing the appended buffer. In addition, this call doesn't make much sense in an asynchronous world, by the time the init segment has been processed, in most cases the SourceBufferParser would have fulled demuxed the content and can't go back and demux more frames from tracks that used to be disabled. We don't want to unnecessarily demuxed frames from tracks that have been disabled, and the real-world usage is that different sourceBuffer would be used when dealing with disabled tracks. The SourceBufferParserWebM also don't implement that method. It's best to completely ignore the tracks that are disabled in the container, they are extremely uncommon and our current handling of those means they would always be ignored anyway.
<rdar://problem/118913735>
Pull request: https://github.com/WebKit/WebKit/pull/21044
Committed 271270@main (98e1d7550182): <https://commits.webkit.org/271270@main> Reviewed commits have been landed. Closing PR #21044 and removing active labels.