Commit 16b1ad74 authored by Mans Rullgard's avatar Mans Rullgard

mqascan: add -b option to set control stream bit position

parent c4d34b41
......@@ -325,7 +325,7 @@ static void write_metadata(const char *file)
metadata_frags = 0;
}
static int scan_file(const char *name, int start)
static int scan_file(const char *name, int start, int mqabit)
{
SNDFILE *file;
SF_INFO fmt;
......@@ -352,7 +352,7 @@ static int scan_file(const char *name, int start)
print_verbosity(verbosity);
if (!setjmp(eofjmp)) {
init_bits_sf(&br, file, 8);
init_bits_sf(&br, file, mqabit);
br.msb = 0;
br.get_bits_cb = get_bits_cb;
br.eof_cb = eof_cb;
......@@ -370,15 +370,19 @@ static int scan_file(const char *name, int start)
int main(int argc, char **argv)
{
const char *mdfile = NULL;
int mqabit = 8;
int start = 0;
int opt;
int i;
while ((opt = getopt(argc, argv, "1m:M:p:s:v")) != -1) {
while ((opt = getopt(argc, argv, "1b:m:M:p:s:v")) != -1) {
switch (opt) {
case '1':
single = 1;
break;
case 'b':
mqabit = strtol(optarg, NULL, 0);
break;
case 'm':
mdfile = optarg;
verbosity = 0;
......@@ -410,7 +414,7 @@ int main(int argc, char **argv)
if (argc > 1)
printf("%s\n", argv[i]);
scan_file(argv[i], start);
scan_file(argv[i], start, mqabit);
if (metadata && mdfile)
write_metadata(mdfile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment