]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
use SNDERR instead of fprintf to print error messages
authorLennart Poettering <lennart@poettering.net>
Thu, 21 Aug 2008 22:05:47 +0000 (00:05 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 3 Sep 2008 18:25:35 +0000 (20:25 +0200)
We shouldn't spam on stderr unconditionally, so let's use ALSA subsystem for
printing errors.

pulse/pcm_pulse.c
pulse/pulse.c

index 10d7aa774e6387c4263a212426029ca25309bd63..7201776bcb2e589b55be4d991f9d416cb36776ff 100644 (file)
@@ -553,8 +553,7 @@ static int pulse_prepare(snd_pcm_ioplug_t * io)
        err =
            pulse_wait_stream_state(pcm->p, pcm->stream, PA_STREAM_READY);
        if (err < 0) {
-               fprintf(stderr,
-                       "*** PULSEAUDIO: Unable to create stream.\n");
+               SNDERR("PulseAudio: Unable to create stream: %s\n", pa_strerror(pa_context_errno(pcm->p->context)));
                pa_stream_unref(pcm->stream);
                pcm->stream = NULL;
                goto finish;
@@ -621,7 +620,7 @@ static int pulse_hw_params(snd_pcm_ioplug_t * io,
                pcm->ss.format = PA_SAMPLE_FLOAT32BE;
                break;
        default:
-               fprintf(stderr, "*** PULSEAUDIO: unsupported format %s\n",
+               SNDERR("PulseAudio: Unsupported format %s\n",
                        snd_pcm_format_name(io->format));
                err = -EINVAL;
                goto finish;
index e738d0727837662b5dee8b22153f2e4067d48909..8a60507ba13e9b94b6419bc9c7d3d67bb9c63218 100644 (file)
@@ -211,7 +211,7 @@ int pulse_connect(snd_pulse_t * p, const char *server)
        return 0;
 
       error:
-       fprintf(stderr, "*** PULSEAUDIO: Unable to connect: %s\n",
+       SNDERR("PulseAudio: Unable to connect: %s\n",
                pa_strerror(pa_context_errno(p->context)));
 
        pa_threaded_mainloop_unlock(p->mainloop);