diff options
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | src/sound.cpp | 19 |
2 files changed, 26 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index 54dbe78..69d6a15 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +indicator-datetime (13.10.0+14.10.20140904.1-0ubuntu1) utopic; urgency=low + + [ Ricardo Salveti de Araujo ] + * sound: adding media role (alarm) when sink is pulsesink + + -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Thu, 04 Sep 2014 21:58:51 +0000 + indicator-datetime (13.10.0+14.10.20140819-0ubuntu1) utopic; urgency=low [ Charles Kerr ] diff --git a/src/sound.cpp b/src/sound.cpp index d13c854..c6a7b0a 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -110,6 +110,25 @@ private: GST_SEEK_TYPE_NONE, (gint64)GST_CLOCK_TIME_NONE); } + else if ((GST_MESSAGE_TYPE(msg) == GST_MESSAGE_STREAM_START) && (self->m_loop)) + { + /* Set the media role if audio sink is pulsesink */ + GstElement *audio_sink = NULL; + g_object_get(self->m_play, "audio-sink", &audio_sink, NULL); + if (audio_sink) + { + GstPluginFeature *feature = NULL; + feature = GST_PLUGIN_FEATURE_CAST(GST_ELEMENT_GET_CLASS(audio_sink)->elementfactory); + if (feature && g_strcmp0(gst_plugin_feature_get_name(feature), "pulsesink") == 0) + { + std::string role_str("props,media.role=alarm"); + GstStructure *props = gst_structure_from_string(role_str.c_str(), NULL); + g_object_set(audio_sink, "stream-properties", props, NULL); + gst_structure_free(props); + } + gst_object_unref(audio_sink); + } + } return G_SOURCE_CONTINUE; // keep listening } |