From: Fabio Estevam Date: Tue, 13 Nov 2012 12:08:14 +0000 (-0200) Subject: ac3dec: Show usage if no parameter is passed X-Git-Tag: v1.0.27~6 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=848e26d10e5d11e33727c318bd2f9eb5cf93e67f;p=alsa-tools.git ac3dec: Show usage if no parameter is passed When ac3dec is called without any argument the application hangs forever. Instead of hanging, print the usage and exit. Signed-off-by: Fabio Estevam Signed-off-by: Takashi Iwai --- diff --git a/ac3dec/ac3dec.c b/ac3dec/ac3dec.c index 00c4f1a..89d7ce8 100644 --- a/ac3dec/ac3dec.c +++ b/ac3dec/ac3dec.c @@ -130,6 +130,11 @@ int main(int argc,char *argv[]) out_config.spdif = SPDIF_NONE; out_config.hdmi = 0; + if (isatty(fileno(stdin)) && (argc == 1)) { + help(); + return 1; + } + morehelp = 0; while (1) { int c;