Default to corect audio device on Raspberry Pi

This commit is contained in:
Iwan Timmer
2016-03-25 11:12:20 +01:00
parent 8de4fe1cf3
commit 68e18a2067
5 changed files with 13 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
/*
* This file is part of Moonlight Embedded.
*
* Copyright (C) 2015 Iwan Timmer
* Copyright (C) 2015, 2016 Iwan Timmer
*
* Moonlight is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -62,6 +62,9 @@ static void alsa_renderer_init(int audioConfiguration, POPUS_MULTISTREAM_CONFIGU
snd_pcm_uframes_t buffer_size = 12 * period_size;
unsigned int sampleRate = opusConfig->sampleRate;
if (audio_device == NULL)
audio_device = "sysdefault";
/* Open PCM device for playback. */
CHECK_RETURN(snd_pcm_open(&handle, audio_device, SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK))

View File

@@ -1,7 +1,7 @@
/*
* This file is part of Moonlight Embedded.
*
* Copyright (C) 2015 Iwan Timmer
* Copyright (C) 2015, 2016 Iwan Timmer
*
* Moonlight is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -131,6 +131,9 @@ static void omx_renderer_init(int audioConfiguration, POPUS_MULTISTREAM_CONFIGUR
}
OMX_CONFIG_BRCMAUDIODESTINATIONTYPE arDest;
if (audio_device == NULL)
audio_device = "hdmi";
if (audio_device && strlen(audio_device) < sizeof(arDest.sName)) {
memset(&arDest, 0, sizeof(OMX_CONFIG_BRCMAUDIODESTINATIONTYPE));
arDest.nSize = sizeof(OMX_CONFIG_BRCMAUDIODESTINATIONTYPE);