summaryrefslogtreecommitdiff
path: root/src/sound.c
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2014-09-14 17:20:21 -0700
committerGlenn Morris <rgm@gnu.org>2014-09-14 17:20:21 -0700
commit11af46027d22daa11d0df7d5032e6925c990dad1 (patch)
tree4d0d528afaf7449dba3cb73af0745980306c57d0 /src/sound.c
parent5ce52d05c93e0c006bbd145b938aa9fab7dfcb8d (diff)
parentd4dc0e1691a15efd1ea0a8793cf889e683a37933 (diff)
downloademacs-11af46027d22daa11d0df7d5032e6925c990dad1.tar.gz
emacs-11af46027d22daa11d0df7d5032e6925c990dad1.tar.bz2
emacs-11af46027d22daa11d0df7d5032e6925c990dad1.zip
Merge from emacs-24; up to 2014-07-09T02:04:12Z!rgm@gnu.org
Diffstat (limited to 'src/sound.c')
-rw-r--r--src/sound.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/sound.c b/src/sound.c
index 9351097138d..7ba14b36f33 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -88,6 +88,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <limits.h>
#include <windows.h>
#include <mmsystem.h>
+
+#include "coding.h"
+#include "w32.h"
/* END: Windows Specific Includes */
#endif /* WINDOWSNT */
@@ -1310,8 +1313,7 @@ Internal use only, use `play-sound' instead. */)
struct gcpro gcpro1, gcpro2;
Lisp_Object args[2];
#else /* WINDOWSNT */
- Lisp_Object lo_file = {0};
- char * psz_file = NULL;
+ Lisp_Object lo_file;
unsigned long ui_volume_tmp = UINT_MAX;
unsigned long ui_volume = UINT_MAX;
#endif /* WINDOWSNT */
@@ -1384,10 +1386,11 @@ Internal use only, use `play-sound' instead. */)
#else /* WINDOWSNT */
- lo_file = Fexpand_file_name (attrs[SOUND_FILE], Qnil);
- len = XSTRING (lo_file)->size;
- psz_file = alloca (len + 1);
- strcpy (psz_file, XSTRING (lo_file)->data);
+ lo_file = Fexpand_file_name (attrs[SOUND_FILE], Vdata_directory);
+ lo_file = ENCODE_FILE (lo_file);
+ /* Since UNICOWS.DLL includes only a stub for mciSendStringW, we
+ need to encode the file in the ANSI codepage. */
+ lo_file = ansi_encode_filename (lo_file);
if (INTEGERP (attrs[SOUND_VOLUME]))
{
ui_volume_tmp = XFASTINT (attrs[SOUND_VOLUME]);
@@ -1409,7 +1412,7 @@ Internal use only, use `play-sound' instead. */)
{
ui_volume = ui_volume_tmp * (UINT_MAX / 100);
}
- do_play_sound (psz_file, ui_volume);
+ do_play_sound (SDATA (lo_file), ui_volume);
#endif /* WINDOWSNT */