alsamixer: use GRectMutext instead of GStaticRecMutex with newer glib versions
This commit is contained in:
parent
9c307bccc5
commit
4828234639
@ -492,7 +492,11 @@ gst_alsa_mixer_new (const char *device, GstAlsaMixerDirection dir)
|
|||||||
if (pipe (ret->pfd) == -1)
|
if (pipe (ret->pfd) == -1)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
#if !GLIB_CHECK_VERSION (2, 31, 0)
|
||||||
g_static_rec_mutex_init (&ret->rec_mutex);
|
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);
|
g_static_rec_mutex_init (&ret->task_mutex);
|
||||||
|
|
||||||
ret->task = gst_task_create (task_monitor_alsa, ret);
|
ret->task = gst_task_create (task_monitor_alsa, ret);
|
||||||
@ -575,8 +579,11 @@ gst_alsa_mixer_free (GstAlsaMixer * mixer)
|
|||||||
snd_mixer_close (mixer->handle);
|
snd_mixer_close (mixer->handle);
|
||||||
mixer->handle = NULL;
|
mixer->handle = NULL;
|
||||||
}
|
}
|
||||||
|
#if !GLIB_CHECK_VERSION (2, 31, 0)
|
||||||
g_static_rec_mutex_free (&mixer->rec_mutex);
|
g_static_rec_mutex_free (&mixer->rec_mutex);
|
||||||
|
#else
|
||||||
|
g_rec_mutex_clear (&mixer->rec_mutex);
|
||||||
|
#endif
|
||||||
|
|
||||||
g_free (mixer);
|
g_free (mixer);
|
||||||
}
|
}
|
||||||
@ -759,8 +766,8 @@ gst_alsa_mixer_set_mute (GstAlsaMixer * mixer, GstMixerTrack * track,
|
|||||||
|
|
||||||
for (i = 0; i < ((GstMixerTrack *) ctrl_track)->num_channels; i++) {
|
for (i = 0; i < ((GstMixerTrack *) ctrl_track)->num_channels; i++) {
|
||||||
long vol =
|
long vol =
|
||||||
mute ? ((GstMixerTrack *) ctrl_track)->
|
mute ? ((GstMixerTrack *) ctrl_track)->min_volume : ctrl_track->
|
||||||
min_volume : ctrl_track->volumes[i];
|
volumes[i];
|
||||||
snd_mixer_selem_set_playback_volume (ctrl_track->element, i, vol);
|
snd_mixer_selem_set_playback_volume (ctrl_track->element, i, vol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,12 @@ struct _GstAlsaMixer
|
|||||||
|
|
||||||
GstTask * task;
|
GstTask * task;
|
||||||
GStaticRecMutex task_mutex;
|
GStaticRecMutex task_mutex;
|
||||||
|
|
||||||
|
#if !GLIB_CHECK_VERSION (2, 31, 0)
|
||||||
GStaticRecMutex rec_mutex;
|
GStaticRecMutex rec_mutex;
|
||||||
|
#else
|
||||||
|
GRecMutex rec_mutex;
|
||||||
|
#endif
|
||||||
|
|
||||||
int pfd[2];
|
int pfd[2];
|
||||||
|
|
||||||
@ -65,8 +70,13 @@ struct _GstAlsaMixer
|
|||||||
GstAlsaMixerDirection dir;
|
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_LOCK(mixer) g_static_rec_mutex_lock (&mixer->rec_mutex)
|
||||||
#define GST_ALSA_MIXER_UNLOCK(mixer) g_static_rec_mutex_unlock (&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,
|
GstAlsaMixer* gst_alsa_mixer_new (const gchar *device,
|
||||||
GstAlsaMixerDirection dir);
|
GstAlsaMixerDirection dir);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user