summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-08-01 20:51:52 +0200
committerwm4 <wm4@nowhere>2015-08-01 21:09:11 +0200
commit41101c2996262c47757bc3bbf39cc11bd7dc5f99 (patch)
tree2add0f03bfd0a318880b9de5888f2ff264ad82d6 /audio
parentfefac2c941149fb49bcb5126060be74494d0c287 (diff)
downloadmpv-41101c2996262c47757bc3bbf39cc11bd7dc5f99.tar.bz2
mpv-41101c2996262c47757bc3bbf39cc11bd7dc5f99.tar.xz
win32: revert wchar_t changes
Revert "win32: more wchar_t -> WCHAR replacements" Revert "win32: replace wchar_t with WCHAR" Doing a "partial" port of this makes no sense anymore from my perspective. Revert the changes, as they're confusing without context, maintenance, and progress. These changes were a bit premature anyway, and might actually cause other issues (locale neutrality etc. as it was pointed out).
Diffstat (limited to 'audio')
-rw-r--r--audio/out/ao_dsound.c4
-rw-r--r--audio/out/ao_wasapi.c5
-rwxr-xr-xaudio/out/ao_wasapi_changenotify.c8
-rwxr-xr-xaudio/out/ao_wasapi_utils.c10
4 files changed, 13 insertions, 14 deletions
diff --git a/audio/out/ao_dsound.c b/audio/out/ao_dsound.c
index 6aae40ce53..c581bf512e 100644
--- a/audio/out/ao_dsound.c
+++ b/audio/out/ao_dsound.c
@@ -174,7 +174,7 @@ static BOOL CALLBACK DirectSoundEnum(LPGUID guid, LPCSTR desc, LPCSTR module,
}
char *guidstr = talloc_strdup(NULL, "");
if (guid) {
- WCHAR guidwstr[80] = {0};
+ wchar_t guidwstr[80] = {0};
StringFromGUID2(guid, guidwstr, MP_ARRAY_SIZE(guidwstr));
char *nstr = mp_to_utf8(NULL, guidwstr);
if (nstr) {
@@ -227,7 +227,7 @@ static int LoadDirectSound(struct ao *ao)
struct priv *p = ao->priv;
// initialize directsound
- p->hdsound_dll = LoadLibraryW(u"DSOUND.DLL");
+ p->hdsound_dll = LoadLibrary(L"DSOUND.DLL");
if (p->hdsound_dll == NULL) {
MP_ERR(ao, "cannot load DSOUND.DLL\n");
return 0;
diff --git a/audio/out/ao_wasapi.c b/audio/out/ao_wasapi.c
index 48487c133f..81b7535c4b 100644
--- a/audio/out/ao_wasapi.c
+++ b/audio/out/ao_wasapi.c
@@ -25,7 +25,6 @@
#include <endpointvolume.h>
#include <mmdeviceapi.h>
#include <avrt.h>
-#include <windows.h>
#include "audio/out/ao_wasapi.h"
#include "audio/out/ao_wasapi_utils.h"
@@ -345,9 +344,9 @@ static int control(struct ao *ao, enum aocontrol cmd, void *arg)
return CONTROL_TRUE;
case AOCONTROL_UPDATE_STREAM_TITLE: {
MP_VERBOSE(state, "Updating stream title to \"%s\"\n", (char*)arg);
- WCHAR *title = mp_from_utf8(NULL, (char*)arg);
+ wchar_t *title = mp_from_utf8(NULL, (char*)arg);
- WCHAR *tmp = NULL;
+ wchar_t *tmp = NULL;
/* There is a weird race condition in the IAudioSessionControl itself --
it seems that *sometimes* the SetDisplayName does not take effect and it still shows
diff --git a/audio/out/ao_wasapi_changenotify.c b/audio/out/ao_wasapi_changenotify.c
index 41a93f6593..1521578b19 100755
--- a/audio/out/ao_wasapi_changenotify.c
+++ b/audio/out/ao_wasapi_changenotify.c
@@ -67,7 +67,7 @@ static HRESULT STDMETHODCALLTYPE sIMMNotificationClient_OnDeviceStateChanged(
if (change->is_hotplug) {
MP_VERBOSE(ao, "OnDeviceStateChanged triggered: sending hotplug event\n");
ao_hotplug_event(ao);
- } else if (pwstrDeviceId && !lstrcmpW(pwstrDeviceId, change->monitored)) {
+ } else if (pwstrDeviceId && !wcscmp(pwstrDeviceId, change->monitored)) {
switch (dwNewState) {
case DEVICE_STATE_DISABLED:
case DEVICE_STATE_NOTPRESENT:
@@ -110,7 +110,7 @@ static HRESULT STDMETHODCALLTYPE sIMMNotificationClient_OnDeviceRemoved(
if (change->is_hotplug) {
MP_VERBOSE(ao, "OnDeviceRemoved triggered: sending hotplug event\n");
ao_hotplug_event(ao);
- } else if (pwstrDeviceId && !lstrcmpW(pwstrDeviceId, change->monitored)) {
+ } else if (pwstrDeviceId && !wcscmp(pwstrDeviceId, change->monitored)) {
MP_VERBOSE(ao, "OnDeviceRemoved triggered for device %S: "
"requesting ao reload\n", pwstrDeviceId);
ao_request_reload(ao);
@@ -144,7 +144,7 @@ static HRESULT STDMETHODCALLTYPE sIMMNotificationClient_OnDefaultDeviceChanged(
}
/* don't reload if already on the new default */
- if (pwstrDeviceId && !lstrcmpW(pwstrDeviceId, change->monitored)) {
+ if (pwstrDeviceId && !wcscmp(pwstrDeviceId, change->monitored)) {
MP_VERBOSE(ao, "OnDefaultDeviceChanged triggered: "
"already using default device, no reload required\n");
return S_OK;
@@ -167,7 +167,7 @@ static HRESULT STDMETHODCALLTYPE sIMMNotificationClient_OnPropertyValueChanged(
struct ao *ao = change->ao;
if (!change->is_hotplug && pwstrDeviceId &&
- !lstrcmpW(pwstrDeviceId, change->monitored))
+ !wcscmp(pwstrDeviceId, change->monitored))
{
MP_VERBOSE(ao, "OnPropertyValueChanged triggered on device %S\n",
pwstrDeviceId);
diff --git a/audio/out/ao_wasapi_utils.c b/audio/out/ao_wasapi_utils.c
index fdd0048ae1..fd65cc82eb 100755
--- a/audio/out/ao_wasapi_utils.c
+++ b/audio/out/ao_wasapi_utils.c
@@ -34,7 +34,7 @@
#include "osdep/io.h"
#include "osdep/timer.h"
-#define MIXER_DEFAULT_LABEL u"mpv - video player"
+#define MIXER_DEFAULT_LABEL L"mpv - video player"
DEFINE_PROPERTYKEY(mp_PKEY_Device_FriendlyName,
0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20,
@@ -190,7 +190,7 @@ bool wasapi_fill_VistaBlob(wasapi_state *state)
{
if (!state)
goto exit_label;
- state->VistaBlob.hAvrt = LoadLibraryW(u"avrt.dll");
+ state->VistaBlob.hAvrt = LoadLibraryW(L"avrt.dll");
if (!state->VistaBlob.hAvrt)
goto exit_label;
@@ -612,7 +612,7 @@ exit_label:
}
static HRESULT init_session_display(struct wasapi_state *state) {
- WCHAR path[MAX_PATH+12] = {0};
+ wchar_t path[MAX_PATH+12] = {0};
HRESULT hr = IAudioClient_GetService(state->pAudioClient,
&IID_IAudioSessionControl,
@@ -620,7 +620,7 @@ static HRESULT init_session_display(struct wasapi_state *state) {
EXIT_ON_ERROR(hr);
GetModuleFileNameW(NULL, path, MAX_PATH);
- lstrcatW(path, u",-IDI_ICON1");
+ lstrcatW(path, L",-IDI_ICON1");
hr = IAudioSessionControl_SetDisplayName(state->pSessionControl, MIXER_DEFAULT_LABEL, NULL);
EXIT_ON_ERROR(hr);
@@ -725,7 +725,7 @@ reinit:
if (state->VistaBlob.hAvrt) {
state->hTask =
- state->VistaBlob.pAvSetMmThreadCharacteristicsW(u"Pro Audio", &state->taskIndex);
+ state->VistaBlob.pAvSetMmThreadCharacteristicsW(L"Pro Audio", &state->taskIndex);
}
MP_VERBOSE(state, "Format fixed. Using %lld byte buffer block size\n",