zapit: add workaround for SPARK driver problems

the h264 decoder seems to not like running out of data, so if the
frontend looses lock, the player2 driver might crash
workaround for now is to stop the video decoder if the lock is lost
This commit is contained in:
Stefan Seyfried
2012-03-17 12:58:11 +01:00
parent 1c86d5b334
commit 0db2f30f3d
2 changed files with 32 additions and 2 deletions

View File

@@ -92,8 +92,6 @@ class CFrontend
/* current frontend instance */ /* current frontend instance */
static CFrontend *currentFe; static CFrontend *currentFe;
bool locked; bool locked;
/* tuning finished flag */
bool tuned;
/* information about the used frontend type */ /* information about the used frontend type */
struct dvb_frontend_info info; struct dvb_frontend_info info;
/* current 22kHz tone mode */ /* current 22kHz tone mode */
@@ -157,6 +155,9 @@ class CFrontend
friend class CFEManager; friend class CFEManager;
public: public:
/* tuning finished flag */
bool tuned;
~CFrontend(void); ~CFrontend(void);
static CFrontend *getInstance(int Number = 0, int Adapter = 0); static CFrontend *getInstance(int Number = 0, int Adapter = 0);

View File

@@ -2068,6 +2068,9 @@ void CZapit::run()
#if 0 #if 0
time_t stime = time(0); time_t stime = time(0);
time_t curtime; time_t curtime;
#endif
#if HAVE_SPARK_HARDWARE
bool v_stopped = false;
#endif #endif
printf("[zapit] starting... tid %ld\n", syscall(__NR_gettid)); printf("[zapit] starting... tid %ld\n", syscall(__NR_gettid));
@@ -2103,7 +2106,33 @@ void CZapit::run()
SendEvent(CZapitClient::EVT_PMT_CHANGED, &channel_id, sizeof(channel_id)); SendEvent(CZapitClient::EVT_PMT_CHANGED, &channel_id, sizeof(channel_id));
} }
} }
#if HAVE_SPARK_HARDWARE
/* hack: stop videodecoder if the tuner looses lock
* at least the h264 decoder seems unhappy if he runs out of data...
* ...until we fix the driver, let's work around it here.
* theoretically, a "retune()" function could also be implemented here
* for the case that the driver cannot re-lock the tuner (DiSEqC problem,
* unicable collision, .... */
if (CFrontend::getInstance()->tuned)
{
if (!CFrontend::getInstance()->getStatus() && !v_stopped)
{
fprintf(stderr, "[zapit] LOST LOCK! stopping video...\n");
videoDecoder->Stop(false);
v_stopped = true;
}
else if (CFrontend::getInstance()->getStatus())
{
if (v_stopped)
{
fprintf(stderr, "[zapit] reacquired LOCK! starting video...\n");
videoDecoder->Start();
}
v_stopped = false;
}
} }
#endif
}
/* yuck, don't waste that much cpu time :) */ /* yuck, don't waste that much cpu time :) */
usleep(0); usleep(0);
#if 0 #if 0