mips/arm: extend audio devs to 4

This commit is contained in:
BPanther
2021-10-03 15:43:01 +02:00
committed by Thilo Graf
parent 627b43ada0
commit 86918294a5
3 changed files with 21 additions and 5 deletions

View File

@@ -14,7 +14,6 @@
#include "hal_debug.h"
#include <config.h>
#define AUDIO_DEVICE "/dev/dvb/adapter0/audio0"
#define hal_debug(args...) _hal_debug(HAL_DEBUG_AUDIO, this, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_AUDIO, this, args)
@@ -39,9 +38,25 @@ enum
};
cAudio *audioDecoder = NULL;
cAudio *pipAudioDecoder = NULL;
cAudio::cAudio(void *, void *, void *)
static const char *ADEV[] =
{
"/dev/dvb/adapter0/audio0",
"/dev/dvb/adapter0/audio1",
"/dev/dvb/adapter0/audio2",
"/dev/dvb/adapter0/audio3"
};
cAudio::cAudio(void *, void *, void *, unsigned int unit)
{
if (unit > 3)
{
hal_info("%s: unit %d out of range, setting to 0\n", __func__, unit);
devnum = 0;
}
else
devnum = unit;
fd = -1;
fdd = false;
clipfd = -1;
@@ -59,7 +74,7 @@ void cAudio::openDevice(void)
{
if (fd < 0)
{
if ((fd = open(AUDIO_DEVICE, O_RDWR)) < 0)
if ((fd = open(ADEV[devnum], O_RDWR)) < 0)
hal_info("openDevice: open failed (%m)\n");
fcntl(fd, F_SETFD, FD_CLOEXEC);
//do_mute(true, false);