summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Reufer <thomas@reufer.ch>2014-05-01 18:26:02 +0200
committerThomas Reufer <thomas@reufer.ch>2014-05-01 18:26:02 +0200
commita0c540b2dd3da65f27640f27c4b12bf09ed9417b (patch)
tree6017209fc417344a9eb687e5649bf81ee5f8a010
parente4483e3f1fdda592f61738027d62b54966fbdbb2 (diff)
downloadvdr-plugin-rpihddevice-a0c540b2dd3da65f27640f27c4b12bf09ed9417b.tar.gz
vdr-plugin-rpihddevice-a0c540b2dd3da65f27640f27c4b12bf09ed9417b.tar.bz2
added cppcheck as Makefile target and code clean up based on cppcheck's results
-rw-r--r--HISTORY5
-rw-r--r--Makefile3
-rw-r--r--audio.c17
-rw-r--r--omx.c8
-rw-r--r--ovgosd.h2
-rw-r--r--setup.c12
6 files changed, 36 insertions, 11 deletions
diff --git a/HISTORY b/HISTORY
index 74dc9be..97a9945 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,11 @@
VDR Plugin 'rpihddevice' Revision History
-----------------------------------------
+- new:
+ - added cppcheck as Makefile target (suggested by Rolf Ahrenberg)
+- fixed:
+ - code clean up based on cppcheck's results (thanks to Rolf Ahrenberg)
+
2014-04-24: Version 0.0.9
-------------------------
- new:
diff --git a/Makefile b/Makefile
index 3012449..8ef9efc 100644
--- a/Makefile
+++ b/Makefile
@@ -142,3 +142,6 @@ clean:
@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~
$(MAKE) --no-print-directory -C $(ILCDIR) clean
+.PHONY: cppcheck
+cppcheck:
+ @cppcheck --language=c++ --enable=all -v -f .
diff --git a/audio.c b/audio.c
index 7548ecf..1e096cb 100644
--- a/audio.c
+++ b/audio.c
@@ -21,9 +21,14 @@ class cRpiAudioDecoder::cParser
public:
- cParser()
+ cParser() :
+ m_mutex(new cMutex()),
+ m_codec(cAudioCodec::eInvalid),
+ m_channels(0),
+ m_samplingRate(0),
+ m_size(0),
+ m_parsed(true)
{
- m_mutex = new cMutex();
}
~cParser()
@@ -178,6 +183,9 @@ public:
private:
+ cParser(const cParser&);
+ cParser& operator= (const cParser&);
+
// Check format of first audio packet in buffer. If format has been
// guessed, but packet is not yet complete, codec is set with a length
// of 0. Once the buffer contains either the exact amount of expected
@@ -204,7 +212,7 @@ private:
// PCM audio can't be found
const uint8_t *p = m_packet.data + offset;
- int n = m_size - offset;
+ unsigned int n = m_size - offset;
switch (FastCheck(p))
{
@@ -507,6 +515,7 @@ private:
return true;
}
+#if 0
///
/// Fast check for AAC LATM audio.
///
@@ -545,6 +554,7 @@ private:
frameSize += 3;
return true;
}
+#endif
///
/// Fast check for ADTS Audio Data Transport Stream.
@@ -682,6 +692,7 @@ cRpiAudioDecoder::cRpiAudioDecoder(cOmx *omx) :
m_parser(new cParser()),
m_omx(omx)
{
+ memset(m_codecs, 0, sizeof(m_codecs));
}
cRpiAudioDecoder::~cRpiAudioDecoder()
diff --git a/omx.c b/omx.c
index dfeba81..8ecb628 100644
--- a/omx.c
+++ b/omx.c
@@ -115,6 +115,9 @@ public:
private:
+ cOmxEvents(const cOmxEvents&);
+ cOmxEvents& operator= (const cOmxEvents&);
+
cCondWait* m_signal;
cMutex* m_mutex;
std::queue<Event*> m_events;
@@ -309,6 +312,7 @@ void cOmx::OnError(void *instance, COMPONENT_T *comp, OMX_U32 data)
cOmx::cOmx() :
cThread(),
+ m_client(NULL),
m_videoWidth(0),
m_videoHeight(0),
m_videoInterlaced(false),
@@ -323,7 +327,9 @@ cOmx::cOmx() :
m_clockScale(0),
m_portEvents(new cOmxEvents()),
m_onBufferStall(0),
- m_onBufferStallData(0)
+ m_onBufferStallData(0),
+ m_onEndOfStream(0),
+ m_onEndOfStreamData(0)
{
memset(m_tun, 0, sizeof(m_tun));
memset(m_comp, 0, sizeof(m_comp));
diff --git a/ovgosd.h b/ovgosd.h
index 311e33a..6ddbc7c 100644
--- a/ovgosd.h
+++ b/ovgosd.h
@@ -15,7 +15,7 @@ class cRpiOsdProvider : public cOsdProvider
{
public:
-
+
cRpiOsdProvider();
~cRpiOsdProvider();
diff --git a/setup.c b/setup.c
index 70842e1..1257f45 100644
--- a/setup.c
+++ b/setup.c
@@ -53,7 +53,7 @@ public:
eOSState ProcessKey(eKeys Key)
{
int newAudioPort = m_newAudioPort;
- bool newPassthrough = m_newPassthrough;
+ int newPassthrough = m_newPassthrough;
eOSState state = cMenuSetupPage::ProcessKey(Key);
@@ -137,14 +137,14 @@ bool cRpiSetup::HwInit(void)
}
}
- int height = 0, width = 0;
- bool progressive = false;
- cRpiVideoPort::ePort port = cRpiVideoPort::eComposite;
-
TV_DISPLAY_STATE_T tvstate;
memset(&tvstate, 0, sizeof(TV_DISPLAY_STATE_T));
if (!vc_tv_get_display_state(&tvstate))
{
+ int height = 0, width = 0;
+ bool progressive = false;
+ cRpiVideoPort::ePort port = cRpiVideoPort::eComposite;
+
// HDMI
if ((tvstate.state & (VC_HDMI_HDMI | VC_HDMI_DVI)))
{
@@ -183,7 +183,7 @@ bool cRpiSetup::IsAudioFormatSupported(cAudioCodec::eCodec codec,
if (codec == cAudioCodec::eMPG || codec == cAudioCodec::eAAC)
return false;
- if (IgnoreAudioEDID())
+ if (GetInstance()->m_ignoreAudioEDID)
return true;
if (vc_tv_hdmi_audio_supported(