static gint output_ref; /* 0 */
static snd_output_t *output; /* NULL */
-static GStaticMutex output_mutex = G_STATIC_MUTEX_INIT;
+static GMutex output_mutex;
static GstStaticPadTemplate alsasink_sink_factory =
GST_STATIC_PAD_TEMPLATE ("sink",
g_free (sink->device);
g_mutex_free (sink->alsa_lock);
- g_static_mutex_lock (&output_mutex);
+ g_mutex_lock (&output_mutex);
--output_ref;
if (output_ref == 0) {
snd_output_close (output);
output = NULL;
}
- g_static_mutex_unlock (&output_mutex);
+ g_mutex_unlock (&output_mutex);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
alsasink->cached_caps = NULL;
alsasink->alsa_lock = g_mutex_new ();
- g_static_mutex_lock (&output_mutex);
+ g_mutex_lock (&output_mutex);
if (output_ref == 0) {
snd_output_stdio_attach (&output, stdout, 0);
++output_ref;
}
- g_static_mutex_unlock (&output_mutex);
+ g_mutex_unlock (&output_mutex);
}
#define CHECK(call, error) \
* easy way to find out the calling object from within the paranoia
* callback, and we need the object instance in there to emit our signals */
static GstCdParanoiaSrc *cur_cb_source;
-static GStaticMutex cur_cb_mutex = G_STATIC_MUTEX_INIT;
+static GMutex cur_cb_mutex;
static gint cdpsrc_signals[NUM_SIGNALS]; /* all 0 */
if (do_serialize) {
GST_LOG_OBJECT (src, "Signal handlers connected, serialising access");
- g_static_mutex_lock (&cur_cb_mutex);
+ g_mutex_lock (&cur_cb_mutex);
GST_LOG_OBJECT (src, "Got lock");
cur_cb_source = src;
cur_cb_source = NULL;
GST_LOG_OBJECT (src, "Releasing lock");
- g_static_mutex_unlock (&cur_cb_mutex);
+ g_mutex_unlock (&cur_cb_mutex);
} else {
cdda_buf = paranoia_read (src->p, gst_cd_paranoia_dummy_callback);
}
static GtkWidget *skip_checkbox, *video_window, *download_checkbox;
static GtkWidget *buffer_checkbox, *rate_spinbutton;
-static GStaticMutex state_mutex = G_STATIC_MUTEX_INIT;
+static GMutex state_mutex;
static GtkWidget *format_combo, *step_amount_spinbutton, *step_rate_spinbutton;
static GtkWidget *shuttle_checkbox, *step_button;
static void
pause_cb (GtkButton * button, gpointer data)
{
- g_static_mutex_lock (&state_mutex);
+ g_mutex_lock (&state_mutex);
if (state != GST_STATE_PAUSED) {
GstStateChangeReturn ret;
state = GST_STATE_PAUSED;
gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, "Paused");
}
- g_static_mutex_unlock (&state_mutex);
+ g_mutex_unlock (&state_mutex);
return;
failed:
{
- g_static_mutex_unlock (&state_mutex);
+ g_mutex_unlock (&state_mutex);
g_print ("PAUSE failed\n");
gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, "Pause failed");
}
g_print ("READY pipeline\n");
gtk_statusbar_pop (GTK_STATUSBAR (statusbar), status_id);
- g_static_mutex_lock (&state_mutex);
+ g_mutex_lock (&state_mutex);
ret = gst_element_set_state (pipeline, STOP_STATE);
if (ret == GST_STATE_CHANGE_FAILURE)
goto failed;
if (pipeline_type == 16)
clear_streams (pipeline);
- g_static_mutex_unlock (&state_mutex);
+ g_mutex_unlock (&state_mutex);
#if 0
/* if one uses parse_launch, play, stop and play again it fails as all the
failed:
{
- g_static_mutex_unlock (&state_mutex);
+ g_mutex_unlock (&state_mutex);
g_print ("STOP failed\n");
gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, "Stop failed");
}
return;
}
- if (g_static_mutex_trylock (&state_mutex)) {
+ if (g_mutex_trylock (&state_mutex)) {
if (shuttling)
do_shuttle (element);
- g_static_mutex_unlock (&state_mutex);
+ g_mutex_unlock (&state_mutex);
} else {
/* ignore step messages that come while we are doing a state change */
g_print ("state change is busy\n");
static GtkWidget *skip_checkbox, *video_window, *download_checkbox;
static GtkWidget *buffer_checkbox, *rate_spinbutton;
-static GStaticMutex state_mutex = G_STATIC_MUTEX_INIT;
+static GMutex state_mutex;
static GtkWidget *format_combo, *step_amount_spinbutton, *step_rate_spinbutton;
static GtkWidget *shuttle_checkbox, *step_button;
static void
pause_cb (GtkButton * button, gpointer data)
{
- g_static_mutex_lock (&state_mutex);
+ g_mutex_lock (&state_mutex);
if (state != GST_STATE_PAUSED) {
GstStateChangeReturn ret;
state = GST_STATE_PAUSED;
gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, "Paused");
}
- g_static_mutex_unlock (&state_mutex);
+ g_mutex_unlock (&state_mutex);
return;
failed:
{
- g_static_mutex_unlock (&state_mutex);
+ g_mutex_unlock (&state_mutex);
g_print ("PAUSE failed\n");
gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, "Pause failed");
}
g_print ("READY pipeline\n");
gtk_statusbar_pop (GTK_STATUSBAR (statusbar), status_id);
- g_static_mutex_lock (&state_mutex);
+ g_mutex_lock (&state_mutex);
ret = gst_element_set_state (pipeline, STOP_STATE);
if (ret == GST_STATE_CHANGE_FAILURE)
goto failed;
if (pipeline_type == 16)
clear_streams (pipeline);
- g_static_mutex_unlock (&state_mutex);
+ g_mutex_unlock (&state_mutex);
#if 0
/* if one uses parse_launch, play, stop and play again it fails as all the
failed:
{
- g_static_mutex_unlock (&state_mutex);
+ g_mutex_unlock (&state_mutex);
g_print ("STOP failed\n");
gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, "Stop failed");
}
return;
}
- if (g_static_mutex_trylock (&state_mutex)) {
+ if (g_mutex_trylock (&state_mutex)) {
if (shuttling)
do_shuttle (element);
- g_static_mutex_unlock (&state_mutex);
+ g_mutex_unlock (&state_mutex);
} else {
/* ignore step messages that come while we are doing a state change */
g_print ("state change is busy\n");