summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2009-04-01 07:45:34 +0200
committerChristian Gmeiner <christian.gmeiner@gmail.com>2009-04-01 07:45:34 +0200
commite44398be1970c48479bef9a0296b479cd71ab5eb (patch)
treed2e75619fe81f2328b3be315beda2a03cba83797
parentecc3dd09be579348e8a17e968415fecaaed47d84 (diff)
downloadvdr-plugin-dxr3-e44398be1970c48479bef9a0296b479cd71ab5eb.tar.gz
vdr-plugin-dxr3-e44398be1970c48479bef9a0296b479cd71ab5eb.tar.bz2
improve cDxr3Interface::ConfigureDevice
-rw-r--r--dxr3configdata.h7
-rw-r--r--dxr3interface.c25
2 files changed, 18 insertions, 14 deletions
diff --git a/dxr3configdata.h b/dxr3configdata.h
index ecb61df..95111b4 100644
--- a/dxr3configdata.h
+++ b/dxr3configdata.h
@@ -24,14 +24,15 @@
#define _DXR3_CONFIGDATA_H_
#include "dxr3singleton.h"
+#include <linux/em8300.h>
// ==================================
//! possible video modes
enum eVideoMode
{
- PAL = 0, ///< use PAL as videomode
- PAL60, ///< use PAL60 as videomode
- NTSC ///< use NTSC as videomode
+ PAL = EM8300_VIDEOMODE_PAL,
+ PAL60 = EM8300_VIDEOMODE_PAL60,
+ NTSC = EM8300_VIDEOMODE_NTSC
};
// ==================================
diff --git a/dxr3interface.c b/dxr3interface.c
index 3621773..6fc538f 100644
--- a/dxr3interface.c
+++ b/dxr3interface.c
@@ -309,11 +309,13 @@ void cDxr3Interface::SingleStep()
// ==================================
void cDxr3Interface::PlayVideoFrame(cFixedLengthFrame* pFrame, int times)
{
+ if (!m_VideoActive) {
+ return;
+ }
+
int written = 0;
int count = 0;
- if (m_VideoActive)
- {
Lock();
for (int i = 0; i < times; i++)
@@ -343,7 +345,6 @@ void cDxr3Interface::PlayVideoFrame(cFixedLengthFrame* pFrame, int times)
uint32_t pts = pFrame->GetPts();
if (pts > 0)
m_lastSeenPts = pts;
- }
}
// ==================================
@@ -561,18 +562,20 @@ void cDxr3Interface::UploadMicroCode()
//! config and setup device via ioctl calls
void cDxr3Interface::ConfigureDevice()
{
- uint32_t videomode = 0;
+ uint32_t videomode = cDxr3ConfigData::Instance().GetVideoMode();
- // set video mode
- if (cDxr3ConfigData::Instance().GetVideoMode() == PAL) {
+ switch (videomode) {
+ case PAL:
dsyslog("dxr3: configure: video mode: PAL");
- videomode = EM8300_VIDEOMODE_PAL;
- } else if (cDxr3ConfigData::Instance().GetVideoMode() == PAL60) {
+ break;
+
+ case PAL60:
dsyslog("dxr3: configure: video mode: PAL60");
- videomode = EM8300_VIDEOMODE_PAL60;
- } else {
+ break;
+
+ case NTSC:
dsyslog("dxr3: configure: video mode: NTSC");
- videomode = EM8300_VIDEOMODE_NTSC;
+ break;
}
if (ioctl(m_fdControl, EM8300_IOCTL_SET_VIDEOMODE, &videomode) == -1) {