Bug#755154: vlc cache gen should happen at runtime, not buildtime

Harald Sitter apachelogger at ubuntu.com
Fri Jul 18 10:52:32 UTC 2014


Package: vlc
Version: 2.1.4-1

since vlc plugins are spread across multiple packages the plugin cache
generated at buildtime is almost always wrong which makes vlc load all
plugins at runtime which in turn can result in runtime symbol clashes
when it loads the qt4 gui in a qt5 libvlc application for example.

this was reported against ubuntu
https://bugs.launchpad.net/ubuntu/+source/vlc/+bug/1328466

and videolan (who pointed out that this is mostly a distro issue)
https://trac.videolan.org/vlc/ticket/9807

and numerous bug reports against KDE because it makes
phonon-backend-vlc fall flat on the face when run against a bogus
cache

attached you should fine a patch which resolves this problem by
a) not installing the buildtime cache
b) fully implementing trigger capability by having postinst refresh the cache
c) have prerm drop the runtime cache so the dirs can be cleaned up
properly by dpkg
-------------- next part --------------
diff -Nru vlc-2.1.4/debian/changelog vlc-2.1.4/debian/changelog
--- vlc-2.1.4/debian/changelog	2014-06-06 16:38:04.000000000 +0200
+++ vlc-2.1.4/debian/changelog	2014-07-18 12:36:53.000000000 +0200
@@ -1,3 +1,23 @@
+vlc (2.1.4-1ubuntu1) utopic; urgency=medium
+
+  * Build the plugins cache at runtime. Since various plugins are spread
+    across different packages we need to use a trigger to rebuild the cache
+    whenever necessary. Otherwise VLC (and libvlc for that matter) will detect
+    the outdated cache and introspect the plugins at runtime which in turn can
+    cause symbol clashes when for example the qt4 gui plugin is loaded in a
+    qt5 libvlc application. This adds on top of the previously introduced
+    triggers file, which was added in an incomplete manner it appears.
+    + New vlc-nox.postinst *always* causing a cache generation.
+      This script always exists 0 when called as a trigger (not that it matters
+      as there is nothing but the cache gen in it right now).
+    + vlc-nox.prerm was adjusted to remove the runtime created cache file to
+      allow for clean directory removal
+    + vlc-nox.install.in was adjusted to not install the buildtime generated
+      plugin cache, as the cache is now always generated a runtime.
+    LP: #1328466
+
+ -- Harald Sitter <apachelogger at kubuntu.org>  Fri, 18 Jul 2014 11:57:12 +0200
+
 vlc (2.1.4-1build1) utopic; urgency=medium
 
   * Rebuild against libgnutls-deb0-28.
diff -Nru vlc-2.1.4/debian/vlc-nox.install.in vlc-2.1.4/debian/vlc-nox.install.in
--- vlc-2.1.4/debian/vlc-nox.install.in	2014-02-15 16:22:05.000000000 +0100
+++ vlc-2.1.4/debian/vlc-nox.install.in	2014-07-18 12:36:38.000000000 +0200
@@ -123,7 +123,8 @@
 usr/lib/vlc/plugins/mmx/libi422_yuy2_mmx_plugin.so
 usr/lib/vlc/plugins/mux
 usr/lib/vlc/plugins/packetizer
-usr/lib/vlc/plugins/plugins.dat
+# NOTE: Plugins.dat is generated at runtime, the postinst explains why.
+#usr/lib/vlc/plugins/plugins.dat
 usr/lib/vlc/plugins/services_discovery/libbonjour_plugin.so
 usr/lib/vlc/plugins/services_discovery/libmediadirs_plugin.so
 usr/lib/vlc/plugins/services_discovery/libmtp_plugin.so
diff -Nru vlc-2.1.4/debian/vlc-nox.postinst vlc-2.1.4/debian/vlc-nox.postinst
--- vlc-2.1.4/debian/vlc-nox.postinst	1970-01-01 01:00:00.000000000 +0100
+++ vlc-2.1.4/debian/vlc-nox.postinst	2014-07-18 12:32:59.000000000 +0200
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -e
+
+# Since we have part of the plugins in other packages we need to forcefully
+# refresh the cache as otherwise VLC will try to load all plugins which can
+# result in unintended symbol clashes for libvlc based applications.
+# Also see https://trac.videolan.org/vlc/ticket/9807
+#          https://bugs.launchpad.net/ubuntu/+source/vlc/+bug/1328466
+if ! /usr/lib/vlc/vlc-cache-gen -f /usr/lib/vlc/plugins/; then
+    echo "WARNING: Regenerating VLC plugin cache failed"
+fi
+
+if [ "$1" = "triggered" ]; then
+    exit 0
+fi
+
+#DEBHELPER#
diff -Nru vlc-2.1.4/debian/vlc-nox.prerm vlc-2.1.4/debian/vlc-nox.prerm
--- vlc-2.1.4/debian/vlc-nox.prerm	2014-02-15 16:22:05.000000000 +0100
+++ vlc-2.1.4/debian/vlc-nox.prerm	2014-07-18 12:32:59.000000000 +0200
@@ -3,4 +3,7 @@
 
 rm -f /usr/lib/vlc/plugins/plugins-*
 
+# Drop the plugins cache generated by postinst
+rm -f /usr/lib/vlc/plugins/plugins.dat
+
 #DEBHELPER#


More information about the pkg-multimedia-maintainers mailing list