Skip to content
Snippets Groups Projects
Commit 5f17d0a7 authored by Steve Lhomme's avatar Steve Lhomme
Browse files

audio_output/winstore: do the MTA+lock before setting the initial device

The requested device is set to the default one in Open and requires the MTA
setup in order for the activation to work. Otherwise it deadlocks.
parent 4bc2b28f
No related branches found
No related tags found
Loading
......@@ -431,6 +431,10 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
if (unlikely(s == NULL))
return -1;
// Load the "out stream" for the requested device
EnterMTA();
EnterCriticalSection(&sys->lock);
if (sys->requested_device != NULL)
{
if (sys->acquired_device == NULL || wcscmp(sys->acquired_device, sys->requested_device))
......@@ -439,16 +443,14 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
DeviceRestartLocked(aout);
if (sys->client == NULL)
{
LeaveCriticalSection(&sys->lock);
LeaveMTA();
vlc_object_delete(&s->obj);
return -1;
}
}
}
// Load the "out stream" for the requested device
EnterMTA();
EnterCriticalSection(&sys->lock);
s->owner.activate = ActivateDevice;
for (;;)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment