From patchwork Sat Mar 9 23:16:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Schmidinger X-Patchwork-Id: 17191 Received: from localhost ([127.0.0.1] helo=www.linuxtv.org) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1UET0I-0000Zj-1G; Sun, 10 Mar 2013 00:16:38 +0100 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1UESzq-0000ZQ-CD for vdr@linuxtv.org; Sun, 10 Mar 2013 00:16:34 +0100 X-tubIT-Incoming-IP: 188.40.50.18 Received: from racoon.tvdr.de ([188.40.50.18]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtps [TLSv1:AES256-SHA:256] for id 1UESzq-0001Zn-9t; Sun, 10 Mar 2013 00:16:10 +0100 Received: from dolphin.tvdr.de (dolphin.tvdr.de [192.168.100.2]) by racoon.tvdr.de (8.14.5/8.14.5) with ESMTP id r29NG9YA005148 for ; Sun, 10 Mar 2013 00:16:09 +0100 Received: from [192.168.100.11] (falcon.tvdr.de [192.168.100.11]) by dolphin.tvdr.de (8.14.4/8.14.4) with ESMTP id r29NG3Ve013705 for ; Sun, 10 Mar 2013 00:16:03 +0100 Message-ID: <513BC2B3.40606@tvdr.de> Date: Sun, 10 Mar 2013 00:16:03 +0100 From: Klaus Schmidinger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 MIME-Version: 1.0 To: vdr@linuxtv.org References: In-Reply-To: X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.3.9.230330 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, MIME_TEXT_ONLY_MP_MIXED 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1900_1999 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __ANY_URI 0, __BAT_BOUNDARY 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_MIXED 0, __FORWARDED_MSG 0, __HAS_FROM 0, __HAS_MSGID 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __MOZILLA_USER_AGENT 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_MAILTO 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __USER_AGENT 0' X-LSpam-Score: -1.1 (-) X-LSpam-Report: No, score=-1.1 required=5.0 tests=BAYES_00=-1.9, RDNS_NONE=0.793 autolearn=no Subject: Re: [vdr] dvbplayer segfault vdr-1.7.39 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: vdr-bounces@linuxtv.org Errors-To: vdr-bounces@linuxtv.org 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 --- dvbplayer.c 2013/02/25 12:15:58 2.32 +++ dvbplayer.c 2013/03/08 13:44:19 @@ -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;