aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2015-01-20 11:01:07 -0600
committerCharles Kerr <charles.kerr@canonical.com>2015-01-20 11:01:07 -0600
commita4ffa788d2f92d1a446f8d6155b111bc79c51a4d (patch)
treed7a242d8bba4014f0a72a474d5c4a583f98f9b48 /src
parent4c53579af096631064d743874b42e9d75a10b00c (diff)
downloadayatana-indicator-datetime-a4ffa788d2f92d1a446f8d6155b111bc79c51a4d.tar.gz
ayatana-indicator-datetime-a4ffa788d2f92d1a446f8d6155b111bc79c51a4d.tar.bz2
ayatana-indicator-datetime-a4ffa788d2f92d1a446f8d6155b111bc79c51a4d.zip
use a local temporary to avoid having to GST_MESSAGE_CAST() twice
Diffstat (limited to 'src')
-rw-r--r--src/sound.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sound.cpp b/src/sound.cpp
index d99fcdd..be0c4f1 100644
--- a/src/sound.cpp
+++ b/src/sound.cpp
@@ -98,8 +98,9 @@ private:
static gboolean bus_callback(GstBus*, GstMessage* msg, gpointer gself)
{
auto self = static_cast<Impl*>(gself);
+ const auto message_type = GST_MESSAGE_TYPE(msg);
- if ((GST_MESSAGE_TYPE(msg) == GST_MESSAGE_EOS) && (self->m_loop))
+ if ((message_type == GST_MESSAGE_EOS) && (self->m_loop))
{
gst_element_seek(self->m_play,
1.0,
@@ -110,7 +111,7 @@ private:
GST_SEEK_TYPE_NONE,
(gint64)GST_CLOCK_TIME_NONE);
}
- else if (GST_MESSAGE_TYPE(msg) == GST_MESSAGE_STREAM_START)
+ else if (message_type == GST_MESSAGE_STREAM_START)
{
/* Set the media role if audio sink is pulsesink */
GstElement *audio_sink = nullptr;