# Build the GStreamer plugin registry if it is missing or empty -- in the # background, never blocking the session. # # GStreamer 0.8 cannot use a plugin it has not catalogued, and it will not # build the catalogue itself: when the registry is absent its in-process # fallback writes a ~100 byte skeleton with no plugins in it and carries on, # so Totem dies with "No default scheduler name - do you have a registry ?". # Only gst-register actually scans the plugin directory. # # The system registry would live under /var, which is tmpfs here and is lost # on every power-off, so this uses the per-user one in $HOME, which persists. # Psion's own gst-plugins recipe ran gst-register from its postinst for the # same reason. # # It MUST be backgrounded. /etc/X11/Xsession sources every file in this # directory in turn and only then execs the window manager, so anything slow # here delays the desktop and anything that hangs prevents it appearing at # all. Scanning ~136 plugins takes over a minute on this hardware, and a # single misbehaving plugin can wedge the scan indefinitely. if [ -x /usr/bin/gst-register-0.8 ]; then ( REGISTRY="$HOME/.gstreamer-0.8/registry.xml" size=0 [ -f "$REGISTRY" ] && size=`wc -c < "$REGISTRY" 2>/dev/null` [ -n "$size" ] || size=0 if [ "$size" -lt 10000 ]; then mkdir -p "$HOME/.gstreamer-0.8" /usr/bin/gst-register-0.8 > /dev/null 2>&1 fi ) & fi