dvbplayer segfault vdr-1.7.39
Commit Message
On 09.03.2013 23:38, Mike Booth wrote:
> I am getting the following message when trying to replay recordings.
>
> kernel: [ 8579.175197] dvbplayer[10786]: segfault at a3c7b0d5 ip 0815e942 sp
> a16cdf50 error 4 in vdr[8048000+171000]
>
>
> Anyone have the same problem or any idea what it means?
>
>
> Using xineliboutput from cvs linux-3.8 and vdr-1.7.39.
Please try if the attached patch fixes this.
Klaus
Comments
Thanks Klaus. That has fixed it.
Mike
Klaus Schmidinger <Klaus.Schmidinger <at> tvdr.de> writes:
Thanks Klaus. That's fixed it.
Regards
Mike
@@ -33,6 +33,7 @@
public:
cPtsIndex(void);
void Clear(void);
+ bool IsEmpty(void);
void Put(uint32_t Pts, int Index);
int FindIndex(uint32_t Pts);
};
@@ -49,6 +50,12 @@
w = r = 0;
}
+bool cPtsIndex::IsEmpty(void)
+{
+ cMutexLock MutexLock(&mutex);
+ return w == r;
+}
+
void cPtsIndex::Put(uint32_t Pts, int Index)
{
cMutexLock MutexLock(&mutex);
@@ -810,12 +817,14 @@
void cDvbPlayer::SetAudioTrack(eTrackType Type, const tTrackId *TrackId)
{
- if (isPesRecording)
- return; // for some unknown reason this doesn't work with PES recordings - causes a segfault
+ if (!cThread::IsMainThread())
+ return; // only do this upon user interaction
if (playMode == pmPlay) {
- int Current, Total;
- if (GetIndex(Current, Total, true))
- Goto(Current);
+ if (!ptsIndex.IsEmpty()) {
+ int Current, Total;
+ if (GetIndex(Current, Total, true))
+ Goto(Current);
+ }
}
else if (playMode == pmPause)
resyncAfterPause = true;