Package: libxine1
Version: 1.0.1-1.2
Severity: important
I'm pasting here the mail I sent recently to d-devel. However, I no
longer plan on reverting the use of shlibdeps.sh to workaround this
bug, since 1.0.2 seems to contain a fix. It seems to work for me, and
so does for the submitter of #326935.
This bug has caused real trouble for several users already, so I would
like to upload fixed packages soon. Probably just with the patch
backported from 1.0.2 (attached), but I can upload 1.0.2 completely if
you say you prefer so. Just let me know if there are something I
should take into account when uploading, or if there are reasons for
which I should not.
Thanks in advance.
* * *
[mail to d-devel starts here]
Hello,
(question for d-d in the last paragraph)
libxine1 ships lots of plugins; if one allows dh_shlibdeps run over
all of them, one gets a pretty big Depends line (though *not*
unbearable in a desktop, IMHO). To avoid this, the maintainer lowers
some of these dependencies to Recommends or Suggests by using
dpkg-shlibdeps -d (on the less common plugins, I imagine). [But the
script doing this has a bug which makes it non-functional, #328184.]
TTBOMK, this works to some extent because xine generates a list of
available plugins in ~/.xine/catalog.cache; if when generating such
list, a plugin fails to load, it is not added to the list.
But imagine this scenario: when running xine for the first time, libX,
which is NEEDED by pluginX, is installed --> pluginX gets listed as
available. After a while, the user removes libX because no package
depends on it. Ideally, on successive runs xine would detect that the
plugin is no longer loadable, and remove it from the list. However,
xine _hangs_, instead of coping... amarok's #327203 is caused by this,
see e.g. #326935 too. Some weird hangup in a futex() call.
I believe the "not coping" above is a xine bug, but one that I have no
time, nor interest, on hunting, reporting upstream, or whatever. I
will file it in our BTS, though, by sending a copy of this mail. But
still, and in the meantime, its effects are biting our users for real.
I plan on workarounding this in a NMU by reverting to plain
dh_shlibdeps behavior until the bug described above gets fixed. For
reference, we're taking about the following dependencies:
shlibs:Depends=libasound2 (>> 1.0.9), libc6 (>= 2.3.5-1), libfreetype6 (>=
2.1.5-1), libglu1-xorg | libglu1, libmodplug0c2 (>= 1:0.7-4.1), libogg0 (>=
1.1.2), libpng12-0 (>= 1.2.8rel), libspeex1, libtheora0, libvorbis0a (>=
1.1.0), libxext6 | xlibs (>> 4.1.0), libxinerama1, xlibmesa-gl | libgl1, zlib1g
(>= 1:1.2.1)
shlibs:Recommends=libmng1 (>= 1.0.3-1), libxv1
shlibs:Suggests=libaa1 (>= 1.2), libartsc0 (>= 1.4.2-1), libaudiofile0 (>=
0.2.3-4), libesd0 (>= 0.2.35) | libesd-alsa0 (>= 0.2.35), libflac7,
libglib2.0-0 (>= 2.8.0), libgnomevfs2-0 (>= 2.10.0-0), libncurses5 (>= 5.4-5),
libsdl1.2debian (>> 1.2.7+1.2.8), libslang2 (>= 2.0.1-1), libsmbclient (>=
3.0.2a-1), libx11-6 | xlibs (>> 4.1.0)
If somebody in -devel has objections, or can think of a better method,
please speak now.
Cheers,
--
Adeodato Simó
EM: asp16 [ykwim] alu.ua.es | PK: DA6AE621
Y sobre todo, tienes mucho de gilipollas.
-- B.C.S. addressing P.G.i.Q in b8g
diff -u -Nrua xine-lib-1.0.1/src/xine-engine/load_plugins.c
xine-lib-1.0.2/src/xine-engine/load_plugins.c
--- xine-lib-1.0.1/src/xine-engine/load_plugins.c 2005-04-26
10:09:12.000000000 +0200
+++ xine-lib-1.0.2/src/xine-engine/load_plugins.c 2005-07-18
03:46:40.000000000 +0200
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: load_plugins.c,v 1.193.2.2 2005/04/20 17:21:16 mroi Exp $
+ * $Id: load_plugins.c,v 1.193.2.5 2005/07/18 01:46:40 miguelfreitas Exp $
*
*
* Load input/demux/audio_out/video_out/codec plugins
@@ -42,6 +42,7 @@
#define LOG_MODULE "load_plugins"
#define LOG_VERBOSE
+
/*
#define LOG
*/
@@ -60,9 +61,10 @@
#include "xineutils.h"
#include "compat.h"
+#if 0
+
static char *plugin_name;
-#if 0
#if DONT_CATCH_SIGSEGV
#define install_segv_handler()
@@ -523,18 +525,18 @@
dir = opendir(path);
if (dir) {
struct dirent *pEntry;
- int path_len;
+ size_t path_len, str_size;
char *str = NULL;
path_len = strlen(path);
- str = malloc(path_len * 2 + 2); /* +2 for '/' and '\0' */
+ str_size = path_len * 2 + 2; /* +2 for '/' and '\0' */
+ str = malloc(str_size);
xine_fast_memcpy(str, path, path_len);
str[path_len] = '/';
str[path_len + 1] = '\0';
while ((pEntry = readdir (dir)) != NULL) {
- size_t str_size = 0;
- size_t new_str_size = 0;
+ size_t new_str_size;
void *lib = NULL;
plugin_info_t *info = NULL;
@@ -725,7 +727,8 @@
break;
}
node->plugin_class = NULL;
- dec_file_ref(node->file);
+ if (node->file)
+ dec_file_ref(node->file);
}
}
@@ -1132,28 +1135,27 @@
xine_t *xine = stream->xine;
plugin_catalog_t *catalog = xine->plugin_catalog;
plugin_node_t *node;
+ input_plugin_t *plugin = NULL;
pthread_mutex_lock (&catalog->lock);
node = xine_list_first_content (catalog->plugin_lists[PLUGIN_INPUT - 1]);
while (node) {
- input_plugin_t *plugin;
- if (!node->plugin_class && !_load_plugin_class(xine, node, NULL))
- return NULL;
- if ((plugin = ((input_class_t
*)node->plugin_class)->get_instance(node->plugin_class, stream, mrl))) {
- inc_node_ref(node);
- plugin->node = node;
- pthread_mutex_unlock (&catalog->lock);
- return plugin;
+ if (node->plugin_class || _load_plugin_class(xine, node, NULL)) {
+ if ((plugin = ((input_class_t
*)node->plugin_class)->get_instance(node->plugin_class, stream, mrl))) {
+ inc_node_ref(node);
+ plugin->node = node;
+ break;
+ }
}
-
+
node = xine_list_next_content
(stream->xine->plugin_catalog->plugin_lists[PLUGIN_INPUT - 1]);
}
pthread_mutex_unlock (&catalog->lock);
- return NULL;
+ return plugin;
}
@@ -1176,6 +1178,7 @@
int i;
int methods[3];
plugin_catalog_t *catalog = stream->xine->plugin_catalog;
+ demux_plugin_t *plugin = NULL;
methods[0] = method1;
methods[1] = method2;
@@ -1187,7 +1190,7 @@
}
i = 0;
- while (methods[i] != -1) {
+ while (methods[i] != -1 && !plugin) {
plugin_node_t *node;
@@ -1198,18 +1201,15 @@
node = xine_list_first_content (catalog->plugin_lists[PLUGIN_DEMUX - 1]);
while (node) {
- demux_plugin_t *plugin;
xprintf(stream->xine, XINE_VERBOSITY_DEBUG, "load_plugins: probing demux
'%s'\n", node->info->id);
- if (!node->plugin_class && !_load_plugin_class(stream->xine, node, NULL))
- return NULL;
-
- if ((plugin = ((demux_class_t
*)node->plugin_class)->open_plugin(node->plugin_class, stream, input))) {
- inc_node_ref(node);
- plugin->node = node;
- pthread_mutex_unlock (&catalog->lock);
- return plugin;
+ if (node->plugin_class || _load_plugin_class(stream->xine, node, NULL)) {
+ if ((plugin = ((demux_class_t
*)node->plugin_class)->open_plugin(node->plugin_class, stream, input))) {
+ inc_node_ref(node);
+ plugin->node = node;
+ break;
+ }
}
node = xine_list_next_content
(stream->xine->plugin_catalog->plugin_lists[PLUGIN_DEMUX - 1]);
@@ -1220,7 +1220,7 @@
i++;
}
- return NULL;
+ return plugin;
}
demux_plugin_t *_x_find_demux_plugin (xine_stream_t *stream, input_plugin_t
*input) {
@@ -1252,7 +1252,7 @@
plugin_catalog_t *catalog = stream->xine->plugin_catalog;
plugin_node_t *node;
- demux_plugin_t *plugin;
+ demux_plugin_t *plugin = NULL;
pthread_mutex_lock(&catalog->lock);
node = xine_list_first_content(catalog->plugin_lists[PLUGIN_DEMUX - 1]);
@@ -1260,21 +1260,19 @@
while (node) {
if (strcasecmp(node->info->id, name) == 0) {
- if (!node->plugin_class && !_load_plugin_class(stream->xine, node, NULL))
- return NULL;
-
- if ((plugin = ((demux_class_t
*)node->plugin_class)->open_plugin(node->plugin_class, stream, input))) {
- inc_node_ref(node);
- plugin->node = node;
- pthread_mutex_unlock (&catalog->lock);
- return plugin;
+ if (node->plugin_class || _load_plugin_class(stream->xine, node, NULL)) {
+ if ((plugin = ((demux_class_t
*)node->plugin_class)->open_plugin(node->plugin_class, stream, input))) {
+ inc_node_ref(node);
+ plugin->node = node;
+ break;
+ }
}
}
node = xine_list_next_content(catalog->plugin_lists[PLUGIN_DEMUX - 1]);
}
pthread_mutex_unlock(&catalog->lock);
- return NULL;
+ return plugin;
}
/*
@@ -1293,14 +1291,14 @@
xine_t *xine = stream->xine;
plugin_catalog_t *catalog = xine->plugin_catalog;
plugin_node_t *last_demux = NULL;
- demux_plugin_t *plugin;
+ demux_plugin_t *plugin = NULL;
methods[0] = METHOD_BY_CONTENT;
methods[1] = METHOD_BY_EXTENSION;
methods[2] = -1;
i = 0;
- while (methods[i] != -1) {
+ while (methods[i] != -1 && !plugin) {
plugin_node_t *node;
@@ -1319,16 +1317,14 @@
} else {
xprintf(stream->xine, XINE_VERBOSITY_DEBUG,
"load_plugin: probing '%s' (method %d)...\n", node->info->id,
stream->content_detection_method );
- if (!node->plugin_class && !_load_plugin_class(xine, node, NULL))
- return NULL;
-
- if ((plugin = ((demux_class_t
*)node->plugin_class)->open_plugin(node->plugin_class, stream, input))) {
- xprintf (stream->xine, XINE_VERBOSITY_DEBUG,
- "load_plugins: using demuxer '%s' (instead of '%s')\n",
node->info->id, last_demux_name);
- inc_node_ref(node);
- plugin->node = node;
- pthread_mutex_unlock (&catalog->lock);
- return plugin;
+ if (node->plugin_class || _load_plugin_class(xine, node, NULL)) {
+ if ((plugin = ((demux_class_t
*)node->plugin_class)->open_plugin(node->plugin_class, stream, input))) {
+ xprintf (stream->xine, XINE_VERBOSITY_DEBUG,
+ "load_plugins: using demuxer '%s' (instead of '%s')\n",
node->info->id, last_demux_name);
+ inc_node_ref(node);
+ plugin->node = node;
+ break;
+ }
}
}
@@ -1340,6 +1336,9 @@
i++;
}
+ if( plugin )
+ return plugin;
+
if( !last_demux )
return NULL;
@@ -1747,6 +1746,7 @@
plugin_node_t *node;
int i, j;
plugin_catalog_t *catalog = stream->xine->plugin_catalog;
+ video_decoder_t *vd = NULL;
lprintf ("looking for video decoder for streamtype %02x\n", stream_type);
@@ -1754,13 +1754,10 @@
for (i = 0; i < PLUGINS_PER_TYPE; i++) {
- video_decoder_t *vd=NULL;
-
node = catalog->video_decoder_map[stream_type][i];
if (!node) {
- pthread_mutex_unlock (&catalog->lock);
- return NULL;
+ break;
}
if (!node->plugin_class && !_load_plugin_class (stream->xine, node, NULL))
{
@@ -1784,8 +1781,7 @@
"load_plugins: plugin %s will be used for video streamtype %02x.\n",
node->info->id, stream_type);
- pthread_mutex_unlock (&catalog->lock);
- return vd;
+ break;
} else {
/* remove non working plugin from catalog */
xprintf(stream->xine, XINE_VERBOSITY_DEBUG,
@@ -1799,7 +1795,7 @@
}
pthread_mutex_unlock (&catalog->lock);
- return NULL;
+ return vd;
}
void _x_free_video_decoder (xine_stream_t *stream, video_decoder_t *vd) {
@@ -1821,6 +1817,7 @@
plugin_node_t *node;
int i, j;
plugin_catalog_t *catalog = stream->xine->plugin_catalog;
+ audio_decoder_t *ad = NULL;
lprintf ("looking for audio decoder for streamtype %02x\n", stream_type);
@@ -1828,13 +1825,10 @@
for (i = 0; i < PLUGINS_PER_TYPE; i++) {
- audio_decoder_t *ad;
-
node = catalog->audio_decoder_map[stream_type][i];
if (!node) {
- pthread_mutex_unlock (&catalog->lock);
- return NULL;
+ break;
}
if (!node->plugin_class && !_load_plugin_class (stream->xine, node, NULL))
{
@@ -1857,8 +1851,7 @@
xprintf(stream->xine, XINE_VERBOSITY_DEBUG,
"load_plugins: plugin %s will be used for audio streamtype %02x.\n",
node->info->id, stream_type);
- pthread_mutex_unlock (&catalog->lock);
- return ad;
+ break;
} else {
/* remove non working plugin from catalog */
xprintf(stream->xine, XINE_VERBOSITY_DEBUG,
@@ -1872,7 +1865,7 @@
}
pthread_mutex_unlock (&catalog->lock);
- return NULL;
+ return ad;
}
void _x_free_audio_decoder (xine_stream_t *stream, audio_decoder_t *ad) {
@@ -1942,7 +1935,7 @@
_unload_unref_plugins(self, self->plugin_catalog->plugin_lists[i]);
}
-#ifdef LOG
+#if 0
{
plugin_file_t *file;
@@ -1970,19 +1963,18 @@
plugin_node_t *node;
int i, j;
plugin_catalog_t *catalog = stream->xine->plugin_catalog;
+ spu_decoder_t *sd = NULL;
lprintf ("looking for spu decoder for streamtype %02x\n", stream_type);
pthread_mutex_lock (&catalog->lock);
for (i = 0; i < PLUGINS_PER_TYPE; i++) {
- spu_decoder_t *sd;
node = catalog->spu_decoder_map[stream_type][i];
if (!node) {
- pthread_mutex_unlock (&catalog->lock);
- return NULL;
+ break;
}
if (!node->plugin_class && !_load_plugin_class (stream->xine, node, NULL))
{
@@ -2005,8 +1997,7 @@
xprintf(stream->xine, XINE_VERBOSITY_DEBUG,
"load_plugins: plugin %s will be used for spu streamtype %02x.\n",
node->info->id, stream_type);
- pthread_mutex_unlock (&catalog->lock);
- return sd;
+ break;
} else {
/* remove non working plugin from catalog */
xprintf(stream->xine, XINE_VERBOSITY_DEBUG,
@@ -2020,7 +2011,7 @@
}
pthread_mutex_unlock (&catalog->lock);
- return NULL;
+ return sd;
}
void _x_free_spu_decoder (xine_stream_t *stream, spu_decoder_t *sd) {
@@ -2150,6 +2141,7 @@
xine_video_port_t **video_target) {
plugin_catalog_t *catalog = xine->plugin_catalog;
plugin_node_t *node;
+ post_plugin_t *post = NULL;
if( !name )
return NULL;
@@ -2160,13 +2152,11 @@
while (node) {
if (strcmp(node->info->id, name) == 0) {
- post_plugin_t *post;
if (!node->plugin_class && !_load_plugin_class(xine, node, NULL)) {
xprintf(xine, XINE_VERBOSITY_DEBUG,
"load_plugins: requested post plugin %s failed to load\n",
name);
- pthread_mutex_unlock(&catalog->lock);
- return NULL;
+ break;
}
post = ((post_class_t
*)node->plugin_class)->open_plugin(node->plugin_class,
@@ -2181,7 +2171,6 @@
post->xine = xine;
post->node = node;
inc_node_ref(node);
- pthread_mutex_unlock(&catalog->lock);
/* init the lists of announced connections */
i = 0;
@@ -2217,12 +2206,11 @@
/* copy the post plugin type to the public part */
post->xine_post.type = ((post_info_t *)node->info->special_info)->type;
- return &post->xine_post;
+ break;
} else {
xprintf(xine, XINE_VERBOSITY_DEBUG,
"load_plugins: post plugin %s failed to instantiate itself\n",
name);
- pthread_mutex_unlock(&catalog->lock);
- return NULL;
+ break;
}
}
@@ -2231,8 +2219,12 @@
pthread_mutex_unlock(&catalog->lock);
- xprintf(xine, XINE_VERBOSITY_DEBUG, "load_plugins: no post plugin named %s
found\n", name);
- return NULL;
+ if(post)
+ return &post->xine_post;
+ else {
+ xprintf(xine, XINE_VERBOSITY_DEBUG, "load_plugins: no post plugin named %s
found\n", name);
+ return NULL;
+ }
}
void xine_post_dispose(xine_t *xine, xine_post_t *post_gen) {