easy fix for mpegdemux being lost for Uraeus and me
authorThomas Vander Stichele <thomas@apestaart.org>
Wed, 5 Jun 2002 21:33:51 +0000 (21:33 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Wed, 5 Jun 2002 21:33:51 +0000 (21:33 +0000)
Original commit message from CVS:
easy fix for mpegdemux being lost for Uraeus and me

gst/mpegstream/gstmpegstream.c

index db922e1..7754dc4 100644 (file)
 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;
 }