Revert "alsasrc: lock calls to snd_pcm_delay() with mutex as in alsasink"

This reverts commit 4f88125b3d.

This seems to have undesirable side-effects and needs more
investigation first.

https://bugzilla.gnome.org/show_bug.cgi?id=746015
This commit is contained in:
Tim-Philipp Müller 2018-03-07 18:50:05 +00:00
parent 5f9c61e08f
commit ae9911617e
2 changed files with 1 additions and 14 deletions

View file

@ -118,7 +118,6 @@ gst_alsasrc_finalize (GObject * object)
g_free (src->device);
g_mutex_clear (&src->alsa_lock);
g_mutex_clear (&src->delay_lock);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@ -276,7 +275,6 @@ gst_alsasrc_init (GstAlsaSrc * alsasrc)
alsasrc->driver_timestamps = FALSE;
g_mutex_init (&alsasrc->alsa_lock);
g_mutex_init (&alsasrc->delay_lock);
}
#define CHECK(call, error) \
@ -960,11 +958,7 @@ gst_alsasrc_read (GstAudioSrc * asrc, gpointer data, guint length,
GST_ALSA_SRC_LOCK (asrc);
while (cptr > 0) {
GST_DELAY_SRC_LOCK (asrc);
err = snd_pcm_readi (alsa->handle, ptr, cptr);
GST_DELAY_SRC_UNLOCK (asrc);
if (err < 0) {
if ((err = snd_pcm_readi (alsa->handle, ptr, cptr)) < 0) {
if (err == -EAGAIN) {
GST_DEBUG_OBJECT (asrc, "Read error: %s", snd_strerror (err));
continue;
@ -1011,9 +1005,7 @@ gst_alsasrc_delay (GstAudioSrc * asrc)
alsa = GST_ALSA_SRC (asrc);
GST_DELAY_SRC_LOCK (asrc);
res = snd_pcm_delay (alsa->handle, &delay);
GST_DELAY_SRC_UNLOCK (asrc);
if (G_UNLIKELY (res < 0)) {
GST_DEBUG_OBJECT (alsa, "snd_pcm_delay returned %d", res);
delay = 0;

View file

@ -39,10 +39,6 @@ G_BEGIN_DECLS
#define GST_ALSA_SRC_LOCK(obj) (g_mutex_lock (GST_ALSA_SRC_GET_LOCK (obj)))
#define GST_ALSA_SRC_UNLOCK(obj) (g_mutex_unlock (GST_ALSA_SRC_GET_LOCK (obj)))
#define GST_DELAY_SRC_GET_LOCK(obj) (&GST_ALSA_SRC_CAST (obj)->delay_lock)
#define GST_DELAY_SRC_LOCK(obj) (g_mutex_lock (GST_DELAY_SRC_GET_LOCK (obj)))
#define GST_DELAY_SRC_UNLOCK(obj) (g_mutex_unlock (GST_DELAY_SRC_GET_LOCK (obj)))
typedef struct _GstAlsaSrc GstAlsaSrc;
typedef struct _GstAlsaSrcClass GstAlsaSrcClass;
@ -75,7 +71,6 @@ struct _GstAlsaSrc {
snd_pcm_uframes_t period_size;
GMutex alsa_lock;
GMutex delay_lock;
};
struct _GstAlsaSrcClass {