aboutsummaryrefslogtreecommitdiffstats
path: root/src/audioOutputs/audioOutput_osx.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2005-03-13 21:33:55 +0000
committerWarren Dukes <warren.dukes@gmail.com>2005-03-13 21:33:55 +0000
commit92f1bb82f7d9b7df73f4f3e09abc97d5fe8e229c (patch)
tree45d9946c3784aafb70cfbb70dc8f4db9c752cedf /src/audioOutputs/audioOutput_osx.c
parent8936789631ce729e44fc8fc0296d4b7c0cf0c5f6 (diff)
downloadmpd-92f1bb82f7d9b7df73f4f3e09abc97d5fe8e229c.tar.gz
mpd-92f1bb82f7d9b7df73f4f3e09abc97d5fe8e229c.tar.xz
mpd-92f1bb82f7d9b7df73f4f3e09abc97d5fe8e229c.zip
some broken OS X stuff
git-svn-id: https://svn.musicpd.org/mpd/trunk@3075 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/audioOutputs/audioOutput_osx.c')
-rw-r--r--src/audioOutputs/audioOutput_osx.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/audioOutputs/audioOutput_osx.c b/src/audioOutputs/audioOutput_osx.c
index d4b3401a1..fc5ae13b9 100644
--- a/src/audioOutputs/audioOutput_osx.c
+++ b/src/audioOutputs/audioOutput_osx.c
@@ -23,9 +23,11 @@
#include "../conf.h"
#include "../log.h"
+#include <CoreAudio/AudioHardware.h>
#include <stdlib.h>
typedef struct _OsxData {
+ AudioDeviceID deviceID;
} OsxData;
static OsxData * newOsxData() {
@@ -34,6 +36,22 @@ static OsxData * newOsxData() {
return ret;
}
+static int osx_testDefault() {
+ int err;
+ AudioDeviceID deviceID;
+ UInt32 propertySize = sizeof(deviceID);
+
+ err = AudioHardwareGetProperty(
+ kAudioHardwarePropertyDefaultOutputDevice,
+ &propertySize, &deviceID);
+ if(err || deviceID == kAudioDeviceUnknown) {
+ WARNING("Not able to get the default OS X device\n");
+ return -1;
+ }
+
+ return 0;
+}
+
static int osx_initDriver(AudioOutput * audioOutput, ConfigParam * param) {
OsxData * od = newOsxData();
@@ -79,7 +97,7 @@ static int osx_play(AudioOutput * audioOutput, char * playChunk, int size) {
AudioOutputPlugin osxPlugin =
{
"osx",
- NULL,
+ osx_testDefault,
osx_initDriver,
osx_finishDriver,
osx_openDevice,