mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-01 16:43:38 +00:00
winegstreamer: Create media source read thread after initializing wg_parser.
Fixes race condition as wg_parser is used right away in the created thread. Signed-off-by: Paul Gofman <pgofman@codeweavers.com> Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8ee30e6dcc
commit
f49b8602e3
|
@ -1315,8 +1315,6 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
|
|||
if (FAILED(hr = MFAllocateWorkQueue(&object->async_commands_queue)))
|
||||
goto fail;
|
||||
|
||||
object->read_thread = CreateThread(NULL, 0, read_thread, object, 0, NULL);
|
||||
|
||||
if (!(parser = unix_funcs->wg_decodebin_parser_create()))
|
||||
{
|
||||
hr = E_OUTOFMEMORY;
|
||||
|
@ -1324,6 +1322,8 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
|
|||
}
|
||||
object->wg_parser = parser;
|
||||
|
||||
object->read_thread = CreateThread(NULL, 0, read_thread, object, 0, NULL);
|
||||
|
||||
object->state = SOURCE_OPENING;
|
||||
|
||||
if (FAILED(hr = unix_funcs->wg_parser_connect(parser, file_size)))
|
||||
|
|
Loading…
Reference in a new issue