Better handling of command line in rds_wav.c
This commit is contained in:
parent
e758ee63a0
commit
dad13529a3
|
|
@ -46,7 +46,10 @@ int main(int argc, char **argv) {
|
|||
set_rds_ps(argv[3]);
|
||||
set_rds_rt(argv[3]);
|
||||
|
||||
if(fm_mpx_open(argv[1], LENGTH) != 0) {
|
||||
char *in_file = argv[1];
|
||||
if(strcmp("NONE", argv[1]) == 0) in_file = NULL;
|
||||
|
||||
if(fm_mpx_open(in_file, LENGTH) != 0) {
|
||||
printf("Could not setup FM mulitplex generator.\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
|
@ -65,8 +68,9 @@ int main(int argc, char **argv) {
|
|||
sfinfo.seekable = 0;
|
||||
|
||||
// Open the output file
|
||||
if (! (outf = sf_open(argv[2], SFM_WRITE, &sfinfo))) {
|
||||
fprintf(stderr, "Error: could not open output file %s.\n", argv[2]) ;
|
||||
char *out_file = argv[2];
|
||||
if (! (outf = sf_open(out_file, SFM_WRITE, &sfinfo))) {
|
||||
fprintf(stderr, "Error: could not open output file %s.\n", out_file);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue