From 42edc14e04ab8c5c2991c7a8e1dc3248a6c32f7c Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Fri, 3 Apr 2020 19:25:10 +0300 Subject: [PATCH] mfreadwrite: Move source shutdown mode to reader flags. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/mfreadwrite/reader.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c index df921307e91..17d274ebc8a 100644 --- a/dlls/mfreadwrite/reader.c +++ b/dlls/mfreadwrite/reader.c @@ -134,6 +134,7 @@ struct source_reader_async_command enum source_reader_flags { SOURCE_READER_FLUSHING = 0x1, + SOURCE_READER_SHUTDOWN_ON_RELEASE = 0x2, }; struct source_reader @@ -148,7 +149,6 @@ struct source_reader DWORD first_audio_stream_index; DWORD first_video_stream_index; IMFSourceReaderCallback *async_callback; - BOOL shutdown_on_release; unsigned int flags; enum media_source_state source_state; struct media_stream *streams; @@ -1186,7 +1186,7 @@ static ULONG WINAPI src_reader_Release(IMFSourceReader *iface) { if (reader->async_callback) IMFSourceReaderCallback_Release(reader->async_callback); - if (reader->shutdown_on_release) + if (reader->flags & SOURCE_READER_SHUTDOWN_ON_RELEASE) IMFMediaSource_Shutdown(reader->source); if (reader->descriptor) IMFPresentationDescriptor_Release(reader->descriptor); @@ -1917,6 +1917,8 @@ static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttri object->async_commands_callback.lpVtbl = &async_commands_callback_vtbl; object->refcount = 1; list_init(&object->responses); + if (shutdown_on_release) + object->flags |= SOURCE_READER_SHUTDOWN_ON_RELEASE; object->source = source; IMFMediaSource_AddRef(object->source); InitializeCriticalSection(&object->cs);