various: use correct PATH_MAX for win32

In commit c09245cdf2
long-path support was enabled for mpv without actually
making sure that there was no code left that used the
old limit (260 Unicode chars) for buffer sizes.
This commit fixes all but one case.
This commit is contained in:
sfan5
2023-12-23 18:46:54 +01:00
parent f57ec94d9f
commit 9565675488
6 changed files with 35 additions and 15 deletions

View File

@@ -576,9 +576,10 @@ static void init_session_display(struct wasapi_state *state, const char *name) {
(void **)&state->pSessionControl);
EXIT_ON_ERROR(hr);
wchar_t path[MAX_PATH] = {0};
GetModuleFileNameW(NULL, path, MAX_PATH);
wchar_t *path = talloc_array(NULL, wchar_t, MP_PATH_MAX);
GetModuleFileNameW(NULL, path, MP_PATH_MAX);
hr = IAudioSessionControl_SetIconPath(state->pSessionControl, path, NULL);
talloc_free(path);
if (FAILED(hr)) {
// don't goto exit_label here since SetDisplayName might still work
MP_WARN(state, "Error setting audio session icon: %s\n",