From 9a9ca677231049af4a6a9975fbf2d369dc8d4014 Mon Sep 17 00:00:00 2001 From: Michael Schwendt Date: Jan 23 2010 20:01:02 +0000 Subject: - Patch filename_find_decoder to probe a file if multiple decoders compete with eachother to handle files with the same extension. This also merges the 2nd chunk of the disabled-iplugins patch. --- diff --git a/audacious-2.2-disabled-iplugins.patch b/audacious-2.2-disabled-iplugins.patch index e89ae28..3ec7d3a 100644 --- a/audacious-2.2-disabled-iplugins.patch +++ b/audacious-2.2-disabled-iplugins.patch @@ -10,37 +10,3 @@ diff -Nur audacious-2.2-orig/src/audacious/playback.c audacious-2.2-fedora/src/a { ProbeResult * pr = input_check_file (filename); -diff -Nur audacious-2.2-orig/src/audacious/playlist-utils.c audacious-2.2-fedora/src/audacious/playlist-utils.c ---- audacious-2.2-orig/src/audacious/playlist-utils.c 2009-11-22 23:43:47.000000000 +0100 -+++ audacious-2.2-fedora/src/audacious/playlist-utils.c 2009-12-31 14:35:14.000000000 +0100 -@@ -288,7 +288,7 @@ - InputPlugin * decoder = NULL; - gchar * temp = g_strdup (filename); - gchar * temp2; -- GList * * index; -+ GList **list_hdr, *node; - - decoder = uri_get_plugin (temp); - -@@ -308,11 +308,17 @@ - temp2 = g_ascii_strdown (temp2 + 1, -1); - g_free (temp); - temp = temp2; -+ list_hdr = g_hash_table_lookup (ext_hash, temp); - -- index = g_hash_table_lookup (ext_hash, temp); -- -- if (index != NULL) -- decoder = (* index)->data; -+ if (list_hdr != NULL) { -+ for (node = *list_hdr; node != NULL; node = g_list_next(node)) { -+ decoder = INPUT_PLUGIN(node->data); -+ if (decoder->enabled) { -+ break; -+ } -+ decoder = NULL; -+ } -+ } - - DONE: - g_free (temp); diff --git a/audacious-2.2-multiple-decoders-per-ext.patch b/audacious-2.2-multiple-decoders-per-ext.patch new file mode 100644 index 0000000..a97e124 --- /dev/null +++ b/audacious-2.2-multiple-decoders-per-ext.patch @@ -0,0 +1,56 @@ +diff -Nur audacious-2.2-orig/src/audacious/playlist-utils.c audacious-2.2-multiple-decoders-per-ext/src/audacious/playlist-utils.c +--- audacious-2.2-orig/src/audacious/playlist-utils.c 2009-11-22 23:43:47.000000000 +0100 ++++ audacious-2.2-multiple-decoders-per-ext/src/audacious/playlist-utils.c 2010-01-21 13:59:13.000000000 +0100 +@@ -286,33 +286,39 @@ + InputPlugin * filename_find_decoder (const gchar * filename) + { + InputPlugin * decoder = NULL; +- gchar * temp = g_strdup (filename); ++ gchar *temp = filename_split_subtune(filename, NULL);; + gchar * temp2; +- GList * * index; ++ GList **list_hdr; + + decoder = uri_get_plugin (temp); + + if (decoder != NULL) + goto DONE; + +- temp2 = strrchr (temp, '?'); +- +- if (temp2 != NULL) +- * temp2 = 0; +- + temp2 = strrchr (temp, '.'); + + if (temp2 == NULL) + goto DONE; + + temp2 = g_ascii_strdown (temp2 + 1, -1); +- g_free (temp); +- temp = temp2; +- +- index = g_hash_table_lookup (ext_hash, temp); ++ list_hdr = g_hash_table_lookup (ext_hash, temp2); ++ g_free(temp2); + +- if (index != NULL) +- decoder = (* index)->data; ++ if (list_hdr != NULL) { ++ if (g_list_length(*list_hdr) > 1) { ++ ProbeResult *pr = input_check_file(temp); ++ if (pr) { ++ decoder = pr->ip; ++ g_free(pr); ++ } ++ } ++ else { ++ InputPlugin* ip = INPUT_PLUGIN((*list_hdr)->data); ++ if (ip->enabled) { ++ decoder = ip; ++ } ++ } ++ } + + DONE: + g_free (temp); diff --git a/audacious.spec b/audacious.spec index c2f770e..362a307 100644 --- a/audacious.spec +++ b/audacious.spec @@ -5,7 +5,7 @@ Name: audacious Version: 2.2 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv3 Summary: GTK2 based media player similar to XMMS @@ -13,12 +13,15 @@ URL: http://audacious-media-player.org/ Group: Applications/Multimedia Source0: http://distfiles.atheme.org/audacious-%{version}.tgz + # not submitted upstream, code section is gone in post-2.2 Patch0: audacious-2.2-disabled-iplugins.patch # obsolete with version upgrade Patch1: audacious-2.2-AUD-99.patch # obsolete with version upgrade Patch2: audacious-2.2-pkgconfig-libs.patch +# for a problem that is known upstream, but 2.3-alpha1 doesn't fixed it yet +Patch3: audacious-2.2-multiple-decoders-per-ext.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -79,6 +82,7 @@ sed -i '\,^.SILENT:,d' buildsys.mk.in %patch0 -p1 -b .disabled-iplugins %patch1 -p1 -b .AUD-99 %patch2 -p1 -b .pkgconfig-libs +%patch3 -p1 -b .multiple-decoders # From .desktop files remove MIME types the base build of the # Fedora audacious-plugins package does not understand. @@ -193,6 +197,11 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %changelog +* Sat Jan 23 2010 Michael Schwendt - 2.2-7 +- Patch filename_find_decoder to probe a file if multiple decoders + compete with eachother to handle files with the same extension. + This also merges the 2nd chunk of the disabled-iplugins patch. + * Sun Jan 17 2010 Michael Schwendt - 2.2-6 - In audacious.pc link with -laudcore instead of -laudclient (AUD-125). This removes a superfluous libaudclient dependency from all plugins and