alsasink: pass correct error to g_strerror

The error we get is a negated errno.

While there, fix a couple typos in messages.
This commit is contained in:
Vincent Penquerc'h 2014-05-19 13:57:41 +01:00
parent 86c698a46f
commit 74e9640a22

View file

@ -969,13 +969,13 @@ gst_alsasink_close (GstAudioSink * asink)
static gint static gint
xrun_recovery (GstAlsaSink * alsa, snd_pcm_t * handle, gint err) xrun_recovery (GstAlsaSink * alsa, snd_pcm_t * handle, gint err)
{ {
GST_DEBUG_OBJECT (alsa, "xrun recovery %d: %s", err, g_strerror (err)); GST_DEBUG_OBJECT (alsa, "xrun recovery %d: %s", err, g_strerror (-err));
if (err == -EPIPE) { /* under-run */ if (err == -EPIPE) { /* under-run */
err = snd_pcm_prepare (handle); err = snd_pcm_prepare (handle);
if (err < 0) if (err < 0)
GST_WARNING_OBJECT (alsa, GST_WARNING_OBJECT (alsa,
"Can't recovery from underrun, prepare failed: %s", "Can't recover from underrun, prepare failed: %s",
snd_strerror (err)); snd_strerror (err));
return 0; return 0;
} else if (err == -ESTRPIPE) { } else if (err == -ESTRPIPE) {
@ -986,7 +986,7 @@ xrun_recovery (GstAlsaSink * alsa, snd_pcm_t * handle, gint err)
err = snd_pcm_prepare (handle); err = snd_pcm_prepare (handle);
if (err < 0) if (err < 0)
GST_WARNING_OBJECT (alsa, GST_WARNING_OBJECT (alsa,
"Can't recovery from suspend, prepare failed: %s", "Can't recover from suspend, prepare failed: %s",
snd_strerror (err)); snd_strerror (err));
} }
return 0; return 0;