]> git.alsa-project.org Git - alsa-tools.git/commitdiff
ac3dec: Show usage if no parameter is passed
authorFabio Estevam <fabio.estevam@freescale.com>
Tue, 13 Nov 2012 12:08:14 +0000 (10:08 -0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 13 Nov 2012 13:26:23 +0000 (14:26 +0100)
When ac3dec is called without any argument the application hangs forever.

Instead of hanging, print the usage and exit.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ac3dec/ac3dec.c

index 00c4f1ac3ed22e362723c1ab7c602e40cde4c5da..89d7ce822667296c76671334331afe8d99cacf6d 100644 (file)
@@ -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;