summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY4
-rw-r--r--dxr3interface.c31
2 files changed, 17 insertions, 18 deletions
diff --git a/HISTORY b/HISTORY
index 44d1208..ad93da9 100644
--- a/HISTORY
+++ b/HISTORY
@@ -269,8 +269,8 @@ NOTE: I havent found time to include all of the languages, will be done in pre2
dxr3interface.c, removed not needed #includes (Christian Gmeiner)
- fixed OSD getting pink (bug #1022810, Christian Gmeiner)
- added support for VDR 1.3.13 and later (Luca Olivetti, Peter Dittmann)
-- if we cant open control fifo, plugin now returns a correct error message
- (Christian Gmeiner)
+- fixed checking of return falues when opening the em8300-* fifos
+ (Christian Gmeiner, Ville Skyttä)
- removed explicit linking with zlib (Christian Gmeiner)
- compiles now with 3.4.x gcc's (Christian Gmeiner, Ville Skyttä)
- use $CXX for generating dependencies instead of hardcoded g++ (Ville Skyttä)
diff --git a/dxr3interface.c b/dxr3interface.c
index 4211048..8f34d08 100644
--- a/dxr3interface.c
+++ b/dxr3interface.c
@@ -61,18 +61,18 @@ static int Dxr3Open(const char *Name, int n, int Mode)
if (fd < 0)
{
cLog::Instance() << "Unable to open " << FileName << "\n";
- return 0;
}
return fd;
}
// ==================================
//! constructor
-cDxr3Interface::cDxr3Interface()
+cDxr3Interface::cDxr3Interface() :
+m_fdControl(-1), m_fdVideo(-1), m_fdAudio(-1), m_fdSpu(-1)
{
// open control stream
m_fdControl = Dxr3Open("", cDxr3ConfigData::Instance().GetDxr3Card(), O_WRONLY | O_SYNC);
- if (!m_fdControl)
+ if (m_fdControl < 0)
{
cLog::Instance() << "Please check if the dxr3 modules are loaded!\n";
exit(1);
@@ -87,9 +87,9 @@ cDxr3Interface::cDxr3Interface()
m_fdSpu = Dxr3Open("_sp", cDxr3ConfigData::Instance().GetDxr3Card(), O_WRONLY | O_SYNC);
// everything ok?
- if (!m_fdVideo || !m_fdAudio || !m_fdSpu)
+ if (m_fdVideo < 0 || m_fdAudio < 0 || m_fdSpu < 0)
{
- cLog::Instance() << "Unable to open one of the 'mulitmedia' streams!\n";
+ cLog::Instance() << "Unable to open one of the 'multimedia' streams!\n";
exit(1);
}
@@ -141,19 +141,19 @@ cDxr3Interface::cDxr3Interface()
cDxr3Interface::~cDxr3Interface()
{
// close filehandles
- if (m_fdControl)
+ if (m_fdControl > -1)
{
close(m_fdControl);
}
- if (m_fdVideo)
+ if (m_fdVideo > -1)
{
close(m_fdVideo);
}
- if (m_fdSpu)
+ if (m_fdSpu > -1)
{
close(m_fdSpu);
}
- if (m_fdAudio)
+ if (m_fdAudio > -1)
{
close(m_fdAudio);
}
@@ -798,10 +798,10 @@ void cDxr3Interface::ExternalReleaseDevices()
if (!m_ExternalReleased)
{
- if (m_fdControl > 0) close(m_fdControl);
- if (m_fdVideo > 0) close(m_fdVideo);
- if (m_fdSpu > 0) close(m_fdSpu);
- if (m_fdAudio > 0) close(m_fdAudio);
+ if (m_fdControl > -1) close(m_fdControl);
+ if (m_fdVideo > -1) close(m_fdVideo);
+ if (m_fdSpu > -1) close(m_fdSpu);
+ if (m_fdAudio > -1) close(m_fdAudio);
m_fdControl = m_fdVideo = m_fdSpu = m_fdAudio = -1;
m_ExternalReleased = true;
@@ -881,7 +881,7 @@ void cDxr3Interface::ReOpenAudio()
if (!m_ExternalReleased)
{
- if (m_fdAudio > 0)
+ if (m_fdAudio > -1)
{
int bufsize = 0;
ioctl(m_fdAudio, SNDCTL_DSP_GETODELAY, &bufsize);
@@ -890,8 +890,7 @@ void cDxr3Interface::ReOpenAudio()
delete m_pClock;
close(m_fdAudio);
- m_fdAudio = open("/dev/em8300_ma-0", O_WRONLY | O_SYNC);
-
+ m_fdAudio = Dxr3Open("_ma", cDxr3ConfigData::Instance().GetDxr3Card(), O_WRONLY | O_SYNC);
uint32_t tmpAudioDataRate = m_audioDataRate;
uint32_t tmpAudioChannelCount = m_audioChannelCount;