diff options
| author | Thomas Reufer <thomas@reufer.ch> | 2014-05-01 18:26:02 +0200 |
|---|---|---|
| committer | Thomas Reufer <thomas@reufer.ch> | 2014-05-01 18:26:02 +0200 |
| commit | a0c540b2dd3da65f27640f27c4b12bf09ed9417b (patch) | |
| tree | 6017209fc417344a9eb687e5649bf81ee5f8a010 | |
| parent | e4483e3f1fdda592f61738027d62b54966fbdbb2 (diff) | |
| download | vdr-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-- | HISTORY | 5 | ||||
| -rw-r--r-- | Makefile | 3 | ||||
| -rw-r--r-- | audio.c | 17 | ||||
| -rw-r--r-- | omx.c | 8 | ||||
| -rw-r--r-- | ovgosd.h | 2 | ||||
| -rw-r--r-- | setup.c | 12 |
6 files changed, 36 insertions, 11 deletions
@@ -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: @@ -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 . @@ -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() @@ -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)); @@ -15,7 +15,7 @@ class cRpiOsdProvider : public cOsdProvider { public: - + cRpiOsdProvider(); ~cRpiOsdProvider(); @@ -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( |
