! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Xfmedia will not add files with capitilized extensions with add directory
Status:
RESOLVED: WONTFIX
Product:
Xfmedia
Component:
playlist

Comments

Description Erik Harrison 2007-11-30 09:05:18 CET
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8) Gecko/20071022 Ubuntu/7.10 (gutsy) Firefox/2.0.0.8
Build Identifier: 

When loading up a whole directory of files Xfmedia pulls out each file's extension and then compares it to a list of extensions with strstr. The list of extensions is pulled from Xine itself, which reports everything in lowercase. So files with uppercase extensions don't get pulled in correctly.

It seems like just changing the line in playlist.c that does the comparison to g_ascii_strdown the file's extension should make it work, although it doesn't here for some reason.


Reproducible: Always
Comment 1 Brian J. Tarricone (not reading bugmail) 2007-11-30 09:25:18 CET
Regardless, g_ascii_strdown() is too slow -- it'll alloc a new string for each one.  Best thing to do would be to store the allowed extensions as an array and then do a case-insensitive binary search to do the test.  But that takes effort.  I guess you could do:

gchar *p, buf[16];
gint i;

p = strrchr(filename, '.');
if(!p)
    continue;
++p;
for(i = 0; i < sizeof(buf) - 1 && p[i]; ++i)
    buf[i] = g_ascii_tolower(p[i]);
buf[i] = 0;
if(!strstr(allowed_exts, buf))
    continue;

That's still slower than what's there, but it's not too bad.
Comment 2 Robby Workman editbugs 2014-12-02 21:44:11 CET
Xfmedia is unmaintained.

Bug #3705

Reported by:
Erik Harrison
Reported on: 2007-11-30
Last modified on: 2014-12-02

People

Assignee:
Brian J. Tarricone (not reading bugmail)
CC List:
1 user

Version

Target Milestone:
xfmedia-0.10.0

Attachments

Additional information