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; }