On 5/31/21 1:11 PM, Giovanni Mascellani wrote:
The following behaviors from Windows are implemented:
- Transitions from STOPPED to PAUSED are forbidden;
- Sample requests are only emitted for transitions from STOPPED to RUNNING (i.e., not when transitioning from PAUSED);
- Transition events are emitted again when transitioning from a state to the same state, except when such state is PAUSED.
Ideally we'd be fixing such issues separately. Anyway, this looks much closer to how it should work. One difference now is that user OnClockPause() callback is called every time, when it should only be called when event was fired.
1146 struct sample_grabber *grabber = impl_from_IMFClockStateSink(iface); 1147 HRESULT hr; 1148 1149 TRACE("%p, %s, %s.\n", iface, debugstr_time(systime), debugstr_time(offset)); 1150 1151 hr = sample_grabber_set_state(grabber, SINK_STATE_RUNNING); 1152 if (FAILED(hr)) 1153 return hr; 1154 1155 return IMFSampleGrabberSinkCallback_OnClockStart(sample_grabber_get_callback(grabber), systime, offset);
This could be nicer, without additional error paths. Maybe by invoking callback from the helper.