Browse Source

Add directory to codec2 dump tool

master
Jeroen Vreeken 3 years ago
parent
commit
98e6e69d91
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      dml_stream_client_codec2.c

+ 10
- 2
dml_stream_client_codec2.c View File

@ -104,9 +104,17 @@ static int data_cb(void *arg, void *data, size_t datasize)
close(fd_dump);
}
char *dname;
asprintf(&dname, "%04d", tm_now.tm_year + 1900);
mkdir(dname, 0777);
free(dname);
asprintf(&dname, "%04d/%02d", tm_now.tm_year + 1900, tm_now.tm_mon + 1);
mkdir(dname, 0777);
free(dname);
char *fname;
asprintf(&fname, "%s.%04d%02d%02d%02d00.wav",
asprintf(&fname, "%04d/%02d/%s.%04d%02d%02d%02d00.wav",
tm_now.tm_year + 1900, tm_now.tm_mon + 1,
dumpfile,
tm_now.tm_year + 1900,
tm_now.tm_mon + 1, tm_now.tm_mday,


Loading…
Cancel
Save