mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
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:
@@ -92,8 +92,6 @@ class CFrontend
|
||||
/* current frontend instance */
|
||||
static CFrontend *currentFe;
|
||||
bool locked;
|
||||
/* tuning finished flag */
|
||||
bool tuned;
|
||||
/* information about the used frontend type */
|
||||
struct dvb_frontend_info info;
|
||||
/* current 22kHz tone mode */
|
||||
@@ -157,6 +155,9 @@ class CFrontend
|
||||
|
||||
friend class CFEManager;
|
||||
public:
|
||||
/* tuning finished flag */
|
||||
bool tuned;
|
||||
|
||||
~CFrontend(void);
|
||||
static CFrontend *getInstance(int Number = 0, int Adapter = 0);
|
||||
|
||||
|
@@ -2068,6 +2068,9 @@ void CZapit::run()
|
||||
#if 0
|
||||
time_t stime = time(0);
|
||||
time_t curtime;
|
||||
#endif
|
||||
#if HAVE_SPARK_HARDWARE
|
||||
bool v_stopped = false;
|
||||
#endif
|
||||
printf("[zapit] starting... tid %ld\n", syscall(__NR_gettid));
|
||||
|
||||
@@ -2103,6 +2106,32 @@ void CZapit::run()
|
||||
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 :) */
|
||||
usleep(0);
|
||||
|
Reference in New Issue
Block a user