The RefPtr<MediaRawData> parameter type allows the caller to choose whether to transfer the reference ownership or not. MediaSourceTrackDemuxer::DoGetSamples() was assuming that AppendSample() would not modify the argument, https://searchfox.org/mozilla-central/rev/6cc05c6620814bf3eb05278ccf3b1f49690b7740/dom/media/mediasource/MediaSourceDemuxer.cpp#495,504 which was inconsistent with the mutable reference parameter. Differential Revision: https://phabricator.services.mozilla.com/D249202