From 590af8cc07e09f6e729c5ea094d83fa73ecfcebd Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Wed, 5 Jun 2002 21:33:51 +0000 Subject: [PATCH] easy fix for mpegdemux being lost for Uraeus and me Original commit message from CVS: easy fix for mpegdemux being lost for Uraeus and me --- gst/mpegstream/gstmpegstream.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gst/mpegstream/gstmpegstream.c b/gst/mpegstream/gstmpegstream.c index db922e11fd..7754dc43e7 100644 --- a/gst/mpegstream/gstmpegstream.c +++ b/gst/mpegstream/gstmpegstream.c @@ -25,9 +25,18 @@ static gboolean plugin_init (GModule *module, GstPlugin *plugin) { - gst_mpeg_parse_plugin_init (module, plugin); - gst_mpeg_demux_plugin_init (module, plugin); - gst_rfc2250_enc_plugin_init (module, plugin); + /* mpegdemux needs the bytestream package */ + if (!gst_library_load ("gstbytestream")) { + gst_info ("mpeg_demux:: could not load support library: 'gstbytestream'\n"); return FALSE; + } + + /* short-circuit here; this is potentially dangerous since if the second + * or third init fails then the whole plug-in will be placed on the register + * stack again and the first _init will be called more than once + * which GType initialization doesn't like */ + if (!gst_mpeg_parse_plugin_init (module, plugin)) return FALSE; + if (!gst_mpeg_demux_plugin_init (module, plugin)) return FALSE; + if (!gst_rfc2250_enc_plugin_init (module, plugin)) return FALSE; return TRUE; }