Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/samplegrabber.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/mf/samplegrabber.c b/dlls/mf/samplegrabber.c index 21f89c0ad0..2167b5001e 100644 --- a/dlls/mf/samplegrabber.c +++ b/dlls/mf/samplegrabber.c @@ -446,7 +446,7 @@ static HRESULT stream_place_marker(struct sample_grabber *grabber, MFSTREAMSINK_ const PROPVARIANT *context_value) { struct scheduled_item *item; - HRESULT hr; + HRESULT hr = S_OK;
if (list_empty(&grabber->items)) { @@ -460,7 +460,9 @@ static HRESULT stream_place_marker(struct sample_grabber *grabber, MFSTREAMSINK_ item->type = ITEM_TYPE_MARKER; item->u.marker.type = marker_type; list_init(&item->entry); - hr = PropVariantCopy(&item->u.marker.context, context_value); + PropVariantInit(&item->u.marker.context); + if (context_value) + hr = PropVariantCopy(&item->u.marker.context, context_value); if (SUCCEEDED(hr)) list_add_tail(&grabber->items, &item->entry); else
Based on patch by Derek Lesho.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/samplegrabber.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/dlls/mf/samplegrabber.c b/dlls/mf/samplegrabber.c index 2167b5001e..7d9fa78732 100644 --- a/dlls/mf/samplegrabber.c +++ b/dlls/mf/samplegrabber.c @@ -739,14 +739,22 @@ static HRESULT WINAPI sample_grabber_stream_timer_callback_Invoke(IMFAsyncCallba if (FAILED(hr = sample_grabber_report_sample(grabber, item->u.sample, &sample_delivered))) WARN("Failed to report a sample, hr %#x.\n", hr); stream_release_pending_item(item); - item = stream_get_next_item(grabber); - if (item && item->type == ITEM_TYPE_SAMPLE) + + /* Schedule next sample, skipping markers. */ + LIST_FOR_EACH_ENTRY(item, &grabber->items, struct scheduled_item, entry) { - if (FAILED(hr = stream_schedule_sample(grabber, item))) - WARN("Failed to schedule a sample, hr %#x.\n", hr); - sample_grabber_stream_request_sample(grabber); - item = NULL; + if (item->type == ITEM_TYPE_SAMPLE) + { + if (FAILED(hr = stream_schedule_sample(grabber, item))) + WARN("Failed to schedule a sample, hr %#x.\n", hr); + break; + } } + + if (sample_delivered) + sample_grabber_stream_request_sample(grabber); + + item = NULL; break; case ITEM_TYPE_MARKER: sample_grabber_stream_report_marker(grabber, &item->u.marker.context, S_OK);