mp3 plugin error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26 Jan 2007 Marco Skambraks <marco@xxxxxxxx> 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@xxxxxx  | 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();

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux