From 7a44796de476efa0c2ce5776c06df589e063d87d Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Fri, 15 May 2020 18:32:54 +0300 Subject: [PATCH] mf/samplegrabber: Remove now unnecessary shutdown state check. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/mf/samplegrabber.c | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/dlls/mf/samplegrabber.c b/dlls/mf/samplegrabber.c index eb116d81edf..24d9163d195 100644 --- a/dlls/mf/samplegrabber.c +++ b/dlls/mf/samplegrabber.c @@ -717,35 +717,32 @@ static HRESULT WINAPI sample_grabber_stream_timer_callback_Invoke(IMFAsyncCallba EnterCriticalSection(&grabber->cs); - if (!grabber->is_shut_down) + LIST_FOR_EACH_ENTRY_SAFE(item, item2, &grabber->items, struct scheduled_item, entry) { - LIST_FOR_EACH_ENTRY_SAFE(item, item2, &grabber->items, struct scheduled_item, entry) + if (item->type == ITEM_TYPE_MARKER) { - if (item->type == ITEM_TYPE_MARKER) + sample_grabber_stream_report_marker(grabber, &item->u.marker.context, S_OK); + stream_release_pending_item(item); + } + else if (item->type == ITEM_TYPE_SAMPLE) + { + if (!sample_reported) { - sample_grabber_stream_report_marker(grabber, &item->u.marker.context, S_OK); + 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); + sample_reported = TRUE; } - else if (item->type == ITEM_TYPE_SAMPLE) + else { - if (!sample_reported) - { - 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); - sample_reported = TRUE; - } - else - { - if (FAILED(hr = stream_schedule_sample(grabber, item))) - WARN("Failed to schedule a sample, hr %#x.\n", hr); - break; - } + 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); } + if (sample_delivered) + sample_grabber_stream_request_sample(grabber); LeaveCriticalSection(&grabber->cs);