# HG changeset patch # User nenolod # Date 1140402051 28800 # Node ID 97113126c7f9215ff2c11e331b228ba62c89bc8e # Parent 02abf3d76832611265c2446fed25cd16afca8e24 [svn] - Fix mp3 detection properly. - Generate thumbnails for nextgen skins as well as WA2.x ones. diff -r 02abf3d76832 -r 97113126c7f9 Plugins/Input/mpg123/mpg123.c --- a/Plugins/Input/mpg123/mpg123.c Sun Feb 19 18:05:14 2006 -0800 +++ b/Plugins/Input/mpg123/mpg123.c Sun Feb 19 18:20:51 2006 -0800 @@ -366,11 +366,14 @@ static int is_our_file(char *filename) { - if (!strncasecmp(filename, "http://", 7)) { + gchar *ext = strrchr(filename, '.'); + + if (!strncasecmp(filename, "http://", 7)) return mpg123_detect_by_content_stream(filename); - } - else + else if (strncasecmp(ext, ".mp3", 7)) /* If extension ends in .mp3, let it be --nenolod */ return (mpg123_detect_by_content(filename)); + + return TRUE; /* Why? The file ends in .mp3. Lalala. */ } static void diff -r 02abf3d76832 -r 97113126c7f9 audacious/skin.c --- a/audacious/skin.c Sun Feb 19 18:05:14 2006 -0800 +++ b/audacious/skin.c Sun Feb 19 18:20:51 2006 -0800 @@ -45,7 +45,7 @@ #define EXTENSION_TARGETS 7 -gchar *ext_targets[EXTENSION_TARGETS] = { "bmp", "xpm", "png", "svg", +static gchar *ext_targets[EXTENSION_TARGETS] = { "bmp", "xpm", "png", "svg", "gif", "jpg", "jpeg" }; struct _SkinPixmapIdMapping { diff -r 02abf3d76832 -r 97113126c7f9 audacious/skinwin.c --- a/audacious/skinwin.c Sun Feb 19 18:05:14 2006 -0800 +++ b/audacious/skinwin.c Sun Feb 19 18:20:51 2006 -0800 @@ -39,6 +39,10 @@ #include +#define EXTENSION_TARGETS 7 + +static gchar *ext_targets[EXTENSION_TARGETS] = { "bmp", "xpm", "png", "svg", + "gif", "jpg", "jpeg" }; #define THUMBNAIL_WIDTH 90 #define THUMBNAIL_HEIGHT 40 @@ -82,20 +86,31 @@ GdkPixbuf *preview = NULL; gchar *dec_path, *preview_path; gboolean is_archive = FALSE; + gint i = 0; + gchar buf[60]; /* gives us lots of room */ - if (file_is_archive(path)) { + if (file_is_archive(path)) + { if (!(dec_path = archive_decompress(path))) return NULL; is_archive = TRUE; } - else { + else + { dec_path = g_strdup(path); } - preview_path = find_file_recursively(dec_path, "main.bmp"); + for (i = 0; i < EXTENSION_TARGETS; i++) + { + sprintf(buf, "main.%s", ext_targets[i]); - if (preview_path) { + if ((preview_path = find_file_recursively(dec_path, "main.bmp")) != NULL) + break; + } + + if (preview_path) + { preview = gdk_pixbuf_new_from_file(preview_path, NULL); g_free(preview_path); }