Skip to content
Permalink
Browse files

Add flags to increase and decrease verbosity level and set default

verbosity to TRC_WARN.
  • Loading branch information
decke committed Jun 10, 2014
1 parent 045ca29 commit 9592a69d27176bbf85f38d884ad2c9460e2a278a
Showing with 26 additions and 6 deletions.
  1. +8 −3 README.md
  2. +17 −2 drmdecrypt.c
  3. +1 −1 trace.h
@@ -21,7 +21,13 @@ This version is fast, POSIX compliant (Linux, FreeBSD, Windows
## Usage

```
drmdecrypt [-x] [-o outdir] infile.srf
Usage: drmdecrypt [-dqvx][-o outdir] infile.srf ...
Options:
-d Show debugging output
-o outdir Output directory
-q Be quiet. Only error output.
-v Version information
-x Disable AES-NI support
```


@@ -35,6 +41,5 @@ make install

## TODO

- flag to specify verbosity level
- MPEG packet size could also be 204 or 208 byte
- Test with Samsung Series D, E, F

@@ -393,7 +393,14 @@ int decryptsrf(char *srffile, char *outdir)

void usage(void)
{
fprintf(stderr, "Usage: drmdecrypt [-x] [-o outdir] infile.srf ...\n");
fprintf(stderr, "Usage: drmdecrypt [-dqvx][-o outdir] infile.srf ...\n");
fprintf(stderr, "Options:\n");
fprintf(stderr, " -d Show debugging output\n");
fprintf(stderr, " -o outdir Output directory\n");
fprintf(stderr, " -q Be quiet. Only error output.\n");
fprintf(stderr, " -v Version information\n");
fprintf(stderr, " -x Disable AES-NI support\n");
fprintf(stderr, "\n");
}

int main(int argc, char *argv[])
@@ -405,13 +412,21 @@ int main(int argc, char *argv[])

enable_aesni = Check_CPU_support_AES();

while ((ch = getopt(argc, argv, "o:vx")) != -1)
while ((ch = getopt(argc, argv, "do:qvx")) != -1)
{
switch (ch)
{
case 'd':
if(tracelevel > TRC_DEBUG)
tracelevel--;
break;
case 'o':
strcpy(outdir, optarg);
break;
case 'q':
if(tracelevel < TRC_ERROR)
tracelevel++;
break;
case 'v':
fprintf(stderr, "drmdecrypt %s (%s)\n\n", VERSION, STR(REVISION));
fprintf(stderr, "Source: http://github.com/decke/drmdecrypt\n");
@@ -14,7 +14,7 @@ enum {
TRC_ERROR
};

static int tracelevel = TRC_INFO;
static int tracelevel = TRC_WARN;

#define trace(L, M, ...) \
if(L >= tracelevel) { \

0 comments on commit 9592a69

Please sign in to comment.
You can’t perform that action at this time.