if (pipe (ret->pfd) == -1)
goto error;
+#if !GLIB_CHECK_VERSION (2, 31, 0)
g_static_rec_mutex_init (&ret->rec_mutex);
+#else
+ g_rec_mutex_init (&ret->rec_mutex);
+#endif
g_static_rec_mutex_init (&ret->task_mutex);
ret->task = gst_task_create (task_monitor_alsa, ret);
snd_mixer_close (mixer->handle);
mixer->handle = NULL;
}
-
+#if !GLIB_CHECK_VERSION (2, 31, 0)
g_static_rec_mutex_free (&mixer->rec_mutex);
+#else
+ g_rec_mutex_clear (&mixer->rec_mutex);
+#endif
g_free (mixer);
}
for (i = 0; i < ((GstMixerTrack *) ctrl_track)->num_channels; i++) {
long vol =
- mute ? ((GstMixerTrack *) ctrl_track)->
- min_volume : ctrl_track->volumes[i];
+ mute ? ((GstMixerTrack *) ctrl_track)->min_volume : ctrl_track->
+ volumes[i];
snd_mixer_selem_set_playback_volume (ctrl_track->element, i, vol);
}
}
GstTask * task;
GStaticRecMutex task_mutex;
+
+#if !GLIB_CHECK_VERSION (2, 31, 0)
GStaticRecMutex rec_mutex;
+#else
+ GRecMutex rec_mutex;
+#endif
int pfd[2];
GstAlsaMixerDirection dir;
};
+#if !GLIB_CHECK_VERSION (2, 31, 0)
#define GST_ALSA_MIXER_LOCK(mixer) g_static_rec_mutex_lock (&mixer->rec_mutex)
#define GST_ALSA_MIXER_UNLOCK(mixer) g_static_rec_mutex_unlock (&mixer->rec_mutex)
+#else
+#define GST_ALSA_MIXER_LOCK(mixer) g_rec_mutex_lock (&mixer->rec_mutex)
+#define GST_ALSA_MIXER_UNLOCK(mixer) g_rec_mutex_unlock (&mixer->rec_mutex)
+#endif
GstAlsaMixer* gst_alsa_mixer_new (const gchar *device,
GstAlsaMixerDirection dir);