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 "hal_debug.h"
#include <config.h> #include <config.h>
#define AUDIO_DEVICE "/dev/dvb/adapter0/audio0"
#define hal_debug(args...) _hal_debug(HAL_DEBUG_AUDIO, this, args) #define hal_debug(args...) _hal_debug(HAL_DEBUG_AUDIO, this, args)
#define hal_info(args...) _hal_info(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 *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; fd = -1;
fdd = false; fdd = false;
clipfd = -1; clipfd = -1;
@@ -59,7 +74,7 @@ void cAudio::openDevice(void)
{ {
if (fd < 0) 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"); hal_info("openDevice: open failed (%m)\n");
fcntl(fd, F_SETFD, FD_CLOEXEC); fcntl(fd, F_SETFD, FD_CLOEXEC);
//do_mute(true, false); //do_mute(true, false);

View File

@@ -27,6 +27,7 @@ class cAudio
private: private:
int fd; int fd;
bool fdd; bool fdd;
unsigned int devnum;
bool Muted; bool Muted;
int clipfd; /* for pcm playback */ int clipfd; /* for pcm playback */
@@ -43,7 +44,7 @@ class cAudio
void setBypassMode(bool disable); void setBypassMode(bool disable);
public: public:
/* construct & destruct */ /* construct & destruct */
cAudio(void *, void *, void *); cAudio(void *, void *, void *, unsigned int unit = 0);
~cAudio(void); ~cAudio(void);
/* used internally by playback */ /* used internally by playback */

View File

@@ -508,7 +508,7 @@ cVideo::cVideo(int, void *, void *, unsigned int unit)
hue = -1; hue = -1;
video_standby = 0; video_standby = 0;
blank_mode = 0; blank_mode = 0;
if (unit > 1) if (unit > 3)
{ {
hal_info("%s: unit %d out of range, setting to 0\n", __func__, unit); hal_info("%s: unit %d out of range, setting to 0\n", __func__, unit);
devnum = 0; devnum = 0;