Could this be because `aSourceBuffer` is captured by reference? It seems it is `SourceBuffer::mTrackBuffersManager` which will go out of scope after the call to `MediaSourceDemuxer::DetachSourceBuffer`: https://searchfox.org/mozilla-central/rev/02841791400cf7cf5760c0cfaf31f5d772624253/dom/media/mediasource/MediaSourceDemuxer.cpp#182 If so, the fix is just something like `sourceBuffer = RefPtr{aSourceBuffer}`.
Bug 1858509 Comment 5 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Could this be because `aSourceBuffer` is captured by reference? It seems it is `SourceBuffer::mTrackBuffersManager` which will go out of scope after the call to `MediaSourceDemuxer::DetachSourceBuffer`: https://searchfox.org/mozilla-central/rev/02841791400cf7cf5760c0cfaf31f5d772624253/dom/media/mediasource/MediaSourceDemuxer.cpp#182 https://searchfox.org/mozilla-central/rev/02841791400cf7cf5760c0cfaf31f5d772624253/dom/media/mediasource/SourceBuffer.cpp#453 If so, the fix is just something like `sourceBuffer = RefPtr{aSourceBuffer}`.