diff options
author | Jens Georg <mail@jensge.org> | 2020-07-25 22:05:32 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2020-07-25 22:06:55 +0200 |
commit | 8f53d90f1a9fa17c52515d4d6687a96e558fcb40 (patch) | |
tree | 36a5a2c46fa13f8c7acf04048eae16ac58197e76 /src | |
parent | ff430c24493a2c9f81efcd95474e4806dee07d58 (diff) | |
download | rygel-8f53d90f1a9fa17c52515d4d6687a96e558fcb40.tar.gz |
gst-launch: Delay root container initialization
The media engine is only ready after the plugin is constructed. We need
to delay the item creation until after that
Fixes #159
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/gst-launch/rygel-gst-launch-plugin.vala | 6 | ||||
-rw-r--r-- | src/plugins/gst-launch/rygel-gst-launch-root-container.vala | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/gst-launch/rygel-gst-launch-plugin.vala b/src/plugins/gst-launch/rygel-gst-launch-plugin.vala index b44ce93c..a4ebef1f 100644 --- a/src/plugins/gst-launch/rygel-gst-launch-plugin.vala +++ b/src/plugins/gst-launch/rygel-gst-launch-plugin.vala @@ -37,4 +37,10 @@ public class Rygel.GstLaunch.Plugin : Rygel.MediaServerPlugin { base (root_container, Plugin.NAME); } + + public override void constructed () { + base.constructed (); + + ((RootContainer) this.root_container).init (); + } } diff --git a/src/plugins/gst-launch/rygel-gst-launch-root-container.vala b/src/plugins/gst-launch/rygel-gst-launch-root-container.vala index 1d3bba45..8c5fbb99 100644 --- a/src/plugins/gst-launch/rygel-gst-launch-root-container.vala +++ b/src/plugins/gst-launch/rygel-gst-launch-root-container.vala @@ -28,9 +28,18 @@ public class Rygel.GstLaunch.RootContainer : SimpleContainer { const string ITEM_NAMES = "launch-items"; MetaConfig config; + bool initialized = false; public RootContainer (string title) { base.root (title); + } + + public void init () { + if (this.initialized) { + return; + } + + this.initialized = true; try { config = MetaConfig.get_default (); |