mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 15:02:58 +02:00
mips/arm: extend audio devs to 4
This commit is contained in:
@@ -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);
|
||||
|
@@ -27,6 +27,7 @@ class cAudio
|
||||
private:
|
||||
int fd;
|
||||
bool fdd;
|
||||
unsigned int devnum;
|
||||
bool Muted;
|
||||
|
||||
int clipfd; /* for pcm playback */
|
||||
@@ -43,7 +44,7 @@ class cAudio
|
||||
void setBypassMode(bool disable);
|
||||
public:
|
||||
/* construct & destruct */
|
||||
cAudio(void *, void *, void *);
|
||||
cAudio(void *, void *, void *, unsigned int unit = 0);
|
||||
~cAudio(void);
|
||||
|
||||
/* used internally by playback */
|
||||
|
@@ -508,7 +508,7 @@ cVideo::cVideo(int, void *, void *, unsigned int unit)
|
||||
hue = -1;
|
||||
video_standby = 0;
|
||||
blank_mode = 0;
|
||||
if (unit > 1)
|
||||
if (unit > 3)
|
||||
{
|
||||
hal_info("%s: unit %d out of range, setting to 0\n", __func__, unit);
|
||||
devnum = 0;
|
||||
|
Reference in New Issue
Block a user