diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2021-08-24 15:26:12 -0400 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-09-20 18:06:44 +0000 |
commit | 7b76c97de92a65cc8347c855cc89af517ad2e8f9 (patch) | |
tree | 5a1b04d7dafb6049afd09e75a2166343ae476082 | |
parent | f3601164d2a63b27f19dc6d1a4227302a59263e5 (diff) | |
download | gstreamer-plugins-base-7b76c97de92a65cc8347c855cc89af517ad2e8f9.tar.gz |
alsasink: Improve logging in write() function
This moves the "written X frames" lower so that we don't trace
confusing negative values on errors and add the error code in the
"Write error" log.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1261>
-rw-r--r-- | ext/alsa/gstalsasink.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/alsa/gstalsasink.c b/ext/alsa/gstalsasink.c index 09ee1ea58..6d7278825 100644 --- a/ext/alsa/gstalsasink.c +++ b/ext/alsa/gstalsasink.c @@ -1072,9 +1072,8 @@ gst_alsasink_write (GstAudioSink * asink, gpointer data, guint length) GST_DELAY_SINK_UNLOCK (asink); } - GST_DEBUG_OBJECT (asink, "written %d frames out of %d", err, cptr); if (err < 0) { - GST_DEBUG_OBJECT (asink, "Write error: %s", snd_strerror (err)); + GST_DEBUG_OBJECT (asink, "Write error: %s (%d)", snd_strerror (err), err); if (err == -EAGAIN) { continue; } else if (err == -ENODEV) { @@ -1089,6 +1088,7 @@ gst_alsasink_write (GstAudioSink * asink, gpointer data, guint length) break; } + GST_DEBUG_OBJECT (asink, "written %d frames out of %d", err, cptr); ptr += snd_pcm_frames_to_bytes (alsa->handle, err); cptr -= err; } |