From patchwork Sat Feb 17 12:08:48 2007 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Huelswitt X-Patchwork-Id: 12437 Received: from wp012.webpack.hosteurope.de ([80.237.132.19]) by www.linuxtv.org with esmtp (Exim 4.50) id 1HIOPw-0007nr-HB for vdr@linuxtv.org; Sat, 17 Feb 2007 13:11:52 +0100 Received: from ip4.35.1411p-cud12k-02.ish.de ([62.143.35.4] helo=video.local.muempf.de); authenticated by wp012.webpack.hosteurope.de running ExIM using esmtpsa (TLSv1:DES-CBC3-SHA:168) id 1HIOOc-0000dE-7t; Sat, 17 Feb 2007 13:10:30 +0100 Received: from video.local.muempf.de (localhost [127.0.0.1]) by video.local.muempf.de (8.12.6/8.12.6/SuSE Linux 0.6) with ESMTP id l1HC8mkJ020329 for ; Sat, 17 Feb 2007 13:08:48 +0100 Received: (from news@localhost) by video.local.muempf.de (8.12.6/8.12.6/Submit) id l1HC8mRr020328 for vdr@linuxtv.org; Sat, 17 Feb 2007 13:08:48 +0100 To: vdr@linuxtv.org Path: not-for-mail From: s.huelswitt@gmx.de (Stefan Huelswitt) Newsgroups: local.linux.vdr Subject: Re: [vdr] mp3 plugin error Date: Sat, 17 Feb 2007 12:08:48 +0000 (UTC) Organization: Home, sweet home Lines: 54 Sender: nathan@gmx.de Message-ID: References: <20070125153822.GA2553@halim.local> NNTP-Posting-Host: master.local.muempf.de Mime-Version: 1.0 X-Trace: video.local.muempf.de 1171714128 18972 192.168.1.1 (17 Feb 2007 12:08:48 GMT) X-Complaints-To: s.huelswitt@gmx.de NNTP-Posting-Date: Sat, 17 Feb 2007 12:08:48 +0000 (UTC) X-Newsreader: knews 1.0b.1 X-bounce-key: webpack.hosteurope.de;s.huelswitt@gmx.de;1171714312;70c16736; X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2007 12:11:52 -0000 Status: O X-Status: X-Keywords: X-UID: 12208 On 26 Jan 2007 Marco Skambraks wrote: > On Thu, 25 Jan 2007, Halim Sahin wrote: >> >> The plugin remembers the last played directory but does not check if the >> dir is >> available before loading it. >> >> A fix can be possible in LoadDir function???? > > I made a dirty hack and it looks OK but not very fast and not nice > menu.c - LoadDir line 141: You're right. Thanks for reporting. I adapted the patch as attached. Regards. --- menu.c +++ menu.c @@ -107,8 +107,7 @@ excl=Excl; SetSource(Source); - LoadDir(currentdir); - SetButtons(); + NewDir(currentdir); } cMenuBrowse::~cMenuBrowse() @@ -157,7 +156,12 @@ bool cMenuBrowse::NewDir(const char *dir) { char *ncur=dir ? strdup(dir):0; - if(LoadDir(ncur)) { + bool r=LoadDir(ncur); + if(!r && ncur) { + free(ncur); ncur=0; + r=LoadDir(ncur); + } + if(r) { free(currentdir); currentdir=ncur; cFileObj *item=CurrentItem();