GMutex *lock;
gboolean async_pending;
+ gboolean need_async_start;
GstPlayFlags flags;
playsink->flags = GST_PLAY_FLAG_SOFT_VOLUME;
playsink->lock = g_mutex_new ();
+ playsink->need_async_start = TRUE;
}
static void
{
GstMessage *message;
+ if (!playsink->need_async_start)
+ return;
+
playsink->async_pending = TRUE;
+ GST_INFO_OBJECT (playsink, "Sending async_start message");
message = gst_message_new_async_start (GST_OBJECT_CAST (playsink), FALSE);
GST_BIN_CLASS (gst_play_sink_parent_class)->handle_message (GST_BIN_CAST
(playsink), message);
GstMessage *message;
if (playsink->async_pending) {
+ GST_INFO_OBJECT (playsink, "Sending async_done message");
message = gst_message_new_async_done (GST_OBJECT_CAST (playsink));
GST_BIN_CLASS (gst_play_sink_parent_class)->handle_message (GST_BIN_CAST
(playsink), message);
playsink->async_pending = FALSE;
}
+
+ playsink->need_async_start = FALSE;
}
/* try to change the state of an element. This function returns the element when
break;
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
/* FIXME Release audio device when we implement that */
+ playsink->need_async_start = TRUE;
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
/* remove sinks we added */