mips/arm: extend audio devs to 4

Origin commit data
------------------
Branch: master
Commit: 6a4994af19
Author: BPanther <bpanther_ts@hotmail.com>
Date: 2021-10-02 (Sat, 02 Oct 2021)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
BPanther
2021-10-02 22:27:44 +02:00
committed by vanhofen
parent 5641a75849
commit ef33b83674
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);