diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-06-13 12:36:02 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-06-13 12:36:02 +0100 |
commit | e79b9d9bab9c18c05cccbff1ae5869377b303560 (patch) | |
tree | dfa276c83d723bdf04973e3d18103cc219b2dcae /indra/media_plugins | |
parent | 788c787ea7bb80d1a9b29f210d9af9f4da5d4cdb (diff) |
SNOW-541 PARTIAL GSTREAMER fail to load (slplugin?)
Robustify the plugin a bunch more, and turn off a dodgy-and-unused visualization feature.
(transplanted from 43273f751dac21d53dba83a90d7f9e057865f789)
Diffstat (limited to 'indra/media_plugins')
-rw-r--r-- | indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp b/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp index 033c4ba2f3..e6d2ad3edc 100644 --- a/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp +++ b/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp @@ -544,8 +544,12 @@ MediaPluginGStreamer010::pause() { DEBUGMSG("pausing media..."); // todo: error-check this? - llgst_element_set_state(mPlaybin, GST_STATE_PAUSED); - return true; + if (mDoneInit && mPlaybin) + { + llgst_element_set_state(mPlaybin, GST_STATE_PAUSED); + return true; + } + return false; } bool @@ -553,8 +557,12 @@ MediaPluginGStreamer010::stop() { DEBUGMSG("stopping media..."); // todo: error-check this? - llgst_element_set_state(mPlaybin, GST_STATE_READY); - return true; + if (mDoneInit && mPlaybin) + { + llgst_element_set_state(mPlaybin, GST_STATE_READY); + return true; + } + return false; } bool @@ -564,8 +572,12 @@ MediaPluginGStreamer010::play(double rate) DEBUGMSG("playing media... rate=%f", rate); // todo: error-check this? - llgst_element_set_state(mPlaybin, GST_STATE_PLAYING); - return true; + if (mDoneInit && mPlaybin) + { + llgst_element_set_state(mPlaybin, GST_STATE_PLAYING); + return true; + } + return false; } bool @@ -608,7 +620,7 @@ bool MediaPluginGStreamer010::getTimePos(double &sec_out) { bool got_position = false; - if (mPlaybin) + if (mDoneInit && mPlaybin) { gint64 pos; GstFormat timefmt = GST_FORMAT_TIME; @@ -688,6 +700,7 @@ MediaPluginGStreamer010::load() this); llgst_object_unref (bus); +#if 0 // not quite stable/correct yet // get a visualizer element (bonus feature!) char* vis_name = getenv("LL_GST_VIS_NAME"); if (!vis_name || @@ -714,6 +727,7 @@ MediaPluginGStreamer010::load() } } } +#endif if (NULL == getenv("LL_GSTREAMER_EXTERNAL")) { // instantiate a custom video sink |