From 2516c6c43ea429126e6aa5ca40225b1ad384a446 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 18 Apr 2006 15:14:43 +0200 Subject: [PATCH] Don't show invalid plug example in the error message of aplay Don't show invalid examples of usage with plug prefix in the error message of aplay/arecord. --- aplay/aplay.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/aplay/aplay.c b/aplay/aplay.c index b6dcc09..fa3fb4e 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -916,8 +916,15 @@ static void set_params(void) assert(err >= 0); if ((float)rate * 1.05 < hwparams.rate || (float)rate * 0.95 > hwparams.rate) { if (!quiet_mode) { + char plugex[64]; fprintf(stderr, _("Warning: rate is not accurate (requested = %iHz, got = %iHz)\n"), rate, hwparams.rate); - fprintf(stderr, _(" please, try the plug plugin (-Dplug:%s)\n"), snd_pcm_name(handle)); + if (strchr(snd_pcm_name(handle), ':')) + *plugex = 0; + else + snprintf(plugex, sizeof(plugex), "(-Dplug:%s)", + snd_pcm_name(handle)); + fprintf(stderr, _(" please, try the plug plugin %s\n"), + plugex); } } rate = hwparams.rate; -- 2.47.1