Nikolay Sivov (@nsivov) commented about dlls/mf/samplegrabber.c:
for (i = 0; i < 4; ++i) sample_grabber_stream_request_sample(grabber); }
else if (state == SINK_STATE_RUNNING && grabber->state == SINK_STATE_PAUSED
&& grabber->received_sample_while_paused)
{
grabber->received_sample_while_paused = FALSE;
sample_grabber_stream_request_sample(grabber);
}
This is inaccurate, it can't use binary flag. With a test you attached, if you send same sample twice while sink is paused you'll get two requests on restart. But it does not accumulate indefinitely, same limit of 4 requests applies here as well. I think we should use a counter instead, reset it to 4 on stop, and increment up to 4 if sample is received when paused. When transitioning back to running, we'll need to issue that number of requests. It will be essentially same path for both start and restart state changes.