winegstreamer: Shut down the read thread before releasing the IMFByteStream.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
a891713f48
commit
2e26556643
|
@ -1211,6 +1211,13 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface)
|
||||||
|
|
||||||
unix_funcs->wg_parser_disconnect(source->wg_parser);
|
unix_funcs->wg_parser_disconnect(source->wg_parser);
|
||||||
|
|
||||||
|
if (source->read_thread)
|
||||||
|
{
|
||||||
|
source->read_thread_shutdown = true;
|
||||||
|
WaitForSingleObject(source->read_thread, INFINITE);
|
||||||
|
CloseHandle(source->read_thread);
|
||||||
|
}
|
||||||
|
|
||||||
if (source->pres_desc)
|
if (source->pres_desc)
|
||||||
IMFPresentationDescriptor_Release(source->pres_desc);
|
IMFPresentationDescriptor_Release(source->pres_desc);
|
||||||
if (source->event_queue)
|
if (source->event_queue)
|
||||||
|
@ -1234,13 +1241,6 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface)
|
||||||
IMFMediaStream_Release(&stream->IMFMediaStream_iface);
|
IMFMediaStream_Release(&stream->IMFMediaStream_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source->read_thread)
|
|
||||||
{
|
|
||||||
source->read_thread_shutdown = true;
|
|
||||||
WaitForSingleObject(source->read_thread, INFINITE);
|
|
||||||
CloseHandle(source->read_thread);
|
|
||||||
}
|
|
||||||
|
|
||||||
unix_funcs->wg_parser_destroy(source->wg_parser);
|
unix_funcs->wg_parser_destroy(source->wg_parser);
|
||||||
|
|
||||||
if (source->stream_count)
|
if (source->stream_count)
|
||||||
|
|
Loading…
Reference in New Issue