summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorscop <scop>2006-02-19 10:38:54 +0000
committerscop <scop>2006-02-19 10:38:54 +0000
commit46743abe6bd5fa4a4fad1213e4976fc07330473c (patch)
treefed793e22619df0062108ec6373c64f44f52c4bc
parent18c11440bd791f1560a7b7431970ac0e4eda6e9d (diff)
downloadvdr-plugin-dxr3-46743abe6bd5fa4a4fad1213e4976fc07330473c.tar.gz
vdr-plugin-dxr3-46743abe6bd5fa4a4fad1213e4976fc07330473c.tar.bz2
Simplify some if/else branches.
-rw-r--r--dxr3device.c38
1 files changed, 14 insertions, 24 deletions
diff --git a/dxr3device.c b/dxr3device.c
index 6bb906e..394c11b 100644
--- a/dxr3device.c
+++ b/dxr3device.c
@@ -256,16 +256,13 @@ int cDxr3Device::PlayVideo(const uchar *Data, int Length)
retLength = m_DemuxDevice.DemuxPes((const uint8_t*)m_strBuf.data(), m_strBuf.length());
}
}
+ else if (m_PlayMode == pmAudioOnly)
+ {
+ retLength = m_DemuxDevice.DemuxAudioPes((const uint8_t*)Data, Length);
+ }
else
{
- if (m_PlayMode == pmAudioOnly)
- {
- retLength = m_DemuxDevice.DemuxAudioPes((const uint8_t*)Data, Length);
- }
- else
- {
- retLength = m_DemuxDevice.DemuxPes((const uint8_t*)Data, Length);
- }
+ retLength = m_DemuxDevice.DemuxPes((const uint8_t*)Data, Length);
}
Length -= retLength;
@@ -274,12 +271,9 @@ int cDxr3Device::PlayVideo(const uchar *Data, int Length)
{
m_strBuf.erase(m_strBuf.length() - retLength, retLength);
}
- else
+ else if (Length)
{
- if (Length)
- {
- m_strBuf.append((const char*)(Data + retLength), Length);
- }
+ m_strBuf.append((const char*)(Data + retLength), Length);
}
return origLength;
@@ -326,14 +320,13 @@ void cDxr3Device::PlayAudio(const uchar *Data, int Length)
retLength = m_DemuxDevice.DemuxPes((const uint8_t*)m_strBuf.data(), m_strBuf.length(), true);
}
}
+ else if (m_PlayMode == pmAudioOnly)
+ {
+ retLength = m_DemuxDevice.DemuxAudioPes((const uint8_t*) Data, Length);
+ }
else
{
- if (m_PlayMode == pmAudioOnly)
- {
- retLength = m_DemuxDevice.DemuxAudioPes((const uint8_t*) Data, Length);
- } else {
- retLength = m_DemuxDevice.DemuxPes((const uint8_t*)Data, Length, true);
- }
+ retLength = m_DemuxDevice.DemuxPes((const uint8_t*)Data, Length, true);
}
Length -= retLength;
@@ -342,12 +335,9 @@ void cDxr3Device::PlayAudio(const uchar *Data, int Length)
{
m_strBuf.erase(m_strBuf.length() - retLength, retLength);
}
- else
+ else if (Length)
{
- if (Length)
- {
- m_strBuf.append((const char*)(Data + retLength), Length);
- }
+ m_strBuf.append((const char*)(Data + retLength), Length);
}
#if VDRVERSNUM >= 10318