Nikolay Sivov (@nsivov) commented about dlls/mfmediaengine/main.c:
goto done;
}
if (FAILED(hr = IMFMediaSink_QueryInterface(engine->audio_renderer.sar, &IID_IMFGetService, (void **)&service)))
goto done;
if (FAILED(hr = IMFGetService_GetService(service, &MR_POLICY_VOLUME_SERVICE, &IID_IMFSimpleAudioVolume, (void **)&sa_volume)))
goto done;
if (SUCCEEDED(hr = IMFSimpleAudioVolume_SetMasterVolume(sa_volume, (float)volume)))
{
engine->volume = volume;
IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_VOLUMECHANGE, 0, 0);
}
IMFSimpleAudioVolume_Release(sa_volume);
First of all, it does not have to be that explicit. You can ask session for volume control service directly, without accessing SAR node yourself. Second point, what happens if volume is set to 0.5 before media item is set? Does it sync this stored volume with session once it's created?