[vdr] mp3 plugin error

Stefan Huelswitt s.huelswitt at gmx.de
Sat Feb 17 13:08:48 CET 2007


On 26 Jan 2007 Marco Skambraks <marco at ammec.de> 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.

-- 
Stefan Huelswitt
s.huelswitt at gmx.de  | http://www.muempf.de/
-------------- next part --------------
--- 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();


More information about the vdr mailing list