summaryrefslogtreecommitdiffstats
path: root/stream/ai_oss.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream/ai_oss.c')
-rw-r--r--stream/ai_oss.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/stream/ai_oss.c b/stream/ai_oss.c
index 0362f207dc..d1ef701e6e 100644
--- a/stream/ai_oss.c
+++ b/stream/ai_oss.c
@@ -87,11 +87,14 @@ int ai_oss_init(audio_in_t *ai)
int err;
int ioctl_param;
- ai->oss.audio_fd = open(ai->oss.device, O_RDONLY | O_CLOEXEC);
+ const char *device = ai->oss.device;
+ if (!device)
+ device = "/dev/dsp";
+
+ ai->oss.audio_fd = open(device, O_RDONLY | O_CLOEXEC);
if (ai->oss.audio_fd < 0)
{
- MP_ERR(ai, "Unable to open '%s': %s\n",
- ai->oss.device, mp_strerror(errno));
+ MP_ERR(ai, "Unable to open '%s': %s\n", device, mp_strerror(errno));
return -1;
}