The segfault occurs in pthread_exit which points at memory corruption...
The problem:
Play live/recording, switch subtitles on. No subtitle packets arrive from
the demuxer (a channel without subtitles or just a part of a programme with
no dialogue).
Navigate or stop (anything to switch from playing to stopped).
cTimeMs returns a small positive integer because it has never been
initialised with anything other than 0.
This value is negated inside an unsigned creating a very large number
for "wakeup" which causes targetTime to overflow to
a negative number. This is supplied to pthread_cond_timedwait which
causes the spin.
Something about this situation causes pthread_exit to segfault
when DVBSubtitles->threadStop() is called.
Also fixed missing else brackets in cTimeMs constructor.
cTimeMs::cTimeMs(int Ms)
{
+ initted = false;
+
if (Ms >= 0)
Set(Ms);
else
+ {
begin = 0;
isFirstCheck = false;
+ }
}
uint64_t cTimeMs::Now(void)
{
isFirstCheck = true; // Timer set, the first check can be done once
begin = Now() + Ms;
+
+ if (Ms) initted = true;
}
bool cTimeMs::TimedOut(void)
uint64_t cTimeMs::Elapsed(void)
{
+ if (!initted) return 0;
return Now() - begin;
}
void Set(int Ms = 0);
bool TimedOut(void);
uint64_t Elapsed(void);
+ bool initted;
};
class OSDReceiver;