[PATCH v4 5/5] winegstreamer: Implement IMFMediaSource::Shutdown.
Nikolay Sivov
nsivov at codeweavers.com
Tue Sep 1 02:50:53 CDT 2020
On 8/28/20 11:48 PM, Derek Lesho wrote:
> @@ -81,6 +87,9 @@ static HRESULT WINAPI media_source_GetEvent(IMFMediaSource *iface, DWORD flags,
>
> TRACE("(%p)->(%#x, %p)\n", source, flags, event);
>
> + if (source->state == SOURCE_SHUTDOWN)
> + return MF_E_SHUTDOWN;
> +
> return IMFMediaEventQueue_GetEvent(source->event_queue, flags, event);
> }
>
> @@ -90,6 +99,9 @@ static HRESULT WINAPI media_source_BeginGetEvent(IMFMediaSource *iface, IMFAsync
>
> TRACE("(%p)->(%p, %p)\n", source, callback, state);
>
> + if (source->state == SOURCE_SHUTDOWN)
> + return MF_E_SHUTDOWN;
> +
> return IMFMediaEventQueue_BeginGetEvent(source->event_queue, callback, state);
> }
This is unnecessary. If the queue is shut down on source->Shutdown(),
you'll get same return value from queue methods. Queue tracks its state
internally.
> static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface)
> {
> struct media_source *source = impl_from_IMFMediaSource(iface);
>
> - FIXME("(%p): stub\n", source);
> + TRACE("(%p)\n", source);
>
> - return E_NOTIMPL;
> + source->state = SOURCE_SHUTDOWN;
> + return media_source_teardown(source);
> }
Related to comment above, it will be shorter to forward to the queue
unconditionally, and only shutdown here, without releasing it.
More information about the wine-devel
mailing list