Commit 2f2b64c8 authored by Mans Rullgard's avatar Mans Rullgard

mqascan: add -1 flag

parent 9024acca
...@@ -59,6 +59,7 @@ static uint32_t csum; ...@@ -59,6 +59,7 @@ static uint32_t csum;
static int verbosity = 1; static int verbosity = 1;
static int packet_type = -1; static int packet_type = -1;
static int single;
static uint32_t update_csum(uint64_t bits, int n) static uint32_t update_csum(uint64_t bits, int n)
{ {
...@@ -293,6 +294,9 @@ static void scan_mqa(struct bitreader *b) ...@@ -293,6 +294,9 @@ static void scan_mqa(struct bitreader *b)
continue; continue;
} }
if (single && (packet_type < 0 || type == packet_type))
break;
abspos += bitnum - startbit; abspos += bitnum - startbit;
csum = abspos & 15; csum = abspos & 15;
} }
...@@ -325,8 +329,11 @@ int main(int argc, char **argv) ...@@ -325,8 +329,11 @@ int main(int argc, char **argv)
int start = 0; int start = 0;
int opt; int opt;
while ((opt = getopt(argc, argv, "m:M:p:s:v")) != -1) { while ((opt = getopt(argc, argv, "1m:M:p:s:v")) != -1) {
switch (opt) { switch (opt) {
case '1':
single = 1;
break;
case 'm': case 'm':
mdfile = optarg; mdfile = optarg;
verbosity = 0; verbosity = 0;
......
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