mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
ao/wasapi: just return 0 unconditionally from the thread
We weren't actually checking this value anyway. We only really cared about init failure, which was checked another way.
This commit is contained in:
@@ -120,18 +120,14 @@ static DWORD __stdcall ThreadLoop(void *lpParameter)
|
|||||||
{
|
{
|
||||||
struct ao *ao = lpParameter;
|
struct ao *ao = lpParameter;
|
||||||
if (!ao || !ao->priv)
|
if (!ao || !ao->priv)
|
||||||
return -1;
|
return 1;
|
||||||
struct wasapi_state *state = (struct wasapi_state *)ao->priv;
|
struct wasapi_state *state = (struct wasapi_state *)ao->priv;
|
||||||
int thread_ret;
|
|
||||||
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
|
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
|
||||||
|
|
||||||
state->init_ret = wasapi_thread_init(ao);
|
state->init_ret = wasapi_thread_init(ao);
|
||||||
SetEvent(state->init_done);
|
SetEvent(state->init_done);
|
||||||
if (state->init_ret != S_OK) {
|
if (state->init_ret != S_OK)
|
||||||
thread_ret = -1;
|
|
||||||
goto exit_label;
|
goto exit_label;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
DWORD waitstatus;
|
DWORD waitstatus;
|
||||||
HANDLE playcontrol[] =
|
HANDLE playcontrol[] =
|
||||||
@@ -143,7 +139,6 @@ static DWORD __stdcall ThreadLoop(void *lpParameter)
|
|||||||
switch (waitstatus) {
|
switch (waitstatus) {
|
||||||
case WAIT_OBJECT_0: /*shutdown*/
|
case WAIT_OBJECT_0: /*shutdown*/
|
||||||
MP_DBG(ao, "Thread shutdown\n");
|
MP_DBG(ao, "Thread shutdown\n");
|
||||||
thread_ret = 0;
|
|
||||||
goto exit_label;
|
goto exit_label;
|
||||||
case (WAIT_OBJECT_0 + 1): /* feed */
|
case (WAIT_OBJECT_0 + 1): /* feed */
|
||||||
thread_feed(ao);
|
thread_feed(ao);
|
||||||
@@ -158,7 +153,6 @@ static DWORD __stdcall ThreadLoop(void *lpParameter)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
MP_ERR(ao, "Unhandled case in thread loop");
|
MP_ERR(ao, "Unhandled case in thread loop");
|
||||||
thread_ret = -1;
|
|
||||||
goto exit_label;
|
goto exit_label;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -166,8 +160,8 @@ exit_label:
|
|||||||
wasapi_thread_uninit(ao);
|
wasapi_thread_uninit(ao);
|
||||||
|
|
||||||
CoUninitialize();
|
CoUninitialize();
|
||||||
MP_DBG(ao, "Thread return %u\n", (unsigned)thread_ret);
|
MP_DBG(ao, "Thread return\n");
|
||||||
return thread_ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void closehandles(struct ao *ao)
|
static void closehandles(struct ao *ao)
|
||||||
|
|||||||
Reference in New Issue
Block a user