diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-09-16 20:20:24 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-09-16 20:20:24 +0200 |
commit | 61fc1727beb76d7ecdc7dd89c0b653e8d9a6ba27 (patch) | |
tree | 1a9185adb54f8aa62339c3d4267b1fd0ed20d635 /plugins/dca | |
parent | 52666d10b9539108dca00c8f35da461592c2879d (diff) |
hidden some of libdca error messages
Diffstat (limited to 'plugins/dca')
-rw-r--r-- | plugins/dca/Makefile.am | 24 | ||||
-rw-r--r-- | plugins/dca/extract_dca.c | 23 | ||||
-rw-r--r-- | plugins/dca/parse.c | 11 |
3 files changed, 32 insertions, 26 deletions
diff --git a/plugins/dca/Makefile.am b/plugins/dca/Makefile.am index 3d0aabb4..d6429b84 100644 --- a/plugins/dca/Makefile.am +++ b/plugins/dca/Makefile.am @@ -9,18 +9,18 @@ parse.c\ bitstream.c\ downmix.c\ convert2s16.c\ -plugins/dca/audio_out.h\ -plugins/dca/dca.h\ -plugins/dca/dts.h\ -plugins/dca/gettimeofday.h\ -plugins/dca/tendra.h\ -plugins/dca/dca_internal.h\ -plugins/dca/tables_adpcm.h\ -plugins/dca/tables_fir.h\ -plugins/dca/tables.h\ -plugins/dca/tables_huffman.h\ -plugins/dca/tables_quantization.h\ -plugins/dca/tables_vq.h +audio_out.h\ +dca.h\ +dts.h\ +gettimeofday.h\ +tendra.h\ +dca_internal.h\ +tables_adpcm.h\ +tables_fir.h\ +tables.h\ +tables_huffman.h\ +tables_quantization.h\ +tables_vq.h dca_la_LDFLAGS = -module diff --git a/plugins/dca/extract_dca.c b/plugins/dca/extract_dca.c index 81534409..58fb105b 100644 --- a/plugins/dca/extract_dca.c +++ b/plugins/dca/extract_dca.c @@ -35,6 +35,9 @@ #endif #include <inttypes.h> +//#define trace(...) { fprintf (stderr, __VA_ARGS__); } +#define trace(fmt,...) + #define BUFFER_SIZE 4096 static uint8_t buffer[BUFFER_SIZE]; static FILE * in_file; @@ -44,7 +47,7 @@ static int demux_pes = 0; static void print_usage (char ** argv) { - fprintf (stderr, "usage: %s [-h] [-s <track>] [-t <pid>] <file>\n" + trace ( "usage: %s [-h] [-s <track>] [-t <pid>] <file>\n" "\t-h\tdisplay help\n" "\t-s\tset track number (0-7 or 0x80-0x87)\n" "\t-t\tuse transport stream demultiplexer, pid 0x10-0x1ffe\n" @@ -66,7 +69,7 @@ static void handle_args (int argc, char ** argv) if (demux_track < 0x80) demux_track += 0x80; if (demux_track < 0x80 || demux_track > 0x87 || *s) { - fprintf (stderr, "Invalid track number: %s\n", optarg); + trace ( "Invalid track number: %s\n", optarg); print_usage (argv); } break; @@ -74,7 +77,7 @@ static void handle_args (int argc, char ** argv) case 't': demux_pid = strtol (optarg, &s, 0); if (demux_pid < 0x10 || demux_pid > 0x1ffe || *s) { - fprintf (stderr, "Invalid pid: %s\n", optarg); + trace ( "Invalid pid: %s\n", optarg); print_usage (argv); } break; @@ -90,7 +93,7 @@ static void handle_args (int argc, char ** argv) if (optind < argc) { in_file = fopen (argv[optind], "rb"); if (!in_file) { - fprintf (stderr, "%s - could not open file %s\n", strerror (errno), + trace ( "%s - could not open file %s\n", strerror (errno), argv[optind]); exit (1); } @@ -218,12 +221,12 @@ static int demux (uint8_t * buf, uint8_t * end, int flags) } if (demux_pid || demux_pes) { if (header[3] != 0xbd) { - fprintf (stderr, "bad stream id %x\n", header[3]); + trace ( "bad stream id %x\n", header[3]); exit (1); } NEEDBYTES (9); if ((header[6] & 0xc0) != 0x80) { /* not mpeg2 */ - fprintf (stderr, "bad multiplex - not mpeg2\n"); + trace ( "bad multiplex - not mpeg2\n"); exit (1); } len = 9 + header[8]; @@ -257,7 +260,7 @@ static int demux (uint8_t * buf, uint8_t * end, int flags) DONEBYTES (12); /* header points to the mpeg1 pack header */ } else { - fprintf (stderr, "weird pack header\n"); + trace ( "weird pack header\n"); DONEBYTES (5); } break; @@ -274,7 +277,7 @@ static int demux (uint8_t * buf, uint8_t * end, int flags) len++; NEEDBYTES (len); if (len == 23) { - fprintf (stderr, "too much stuffing\n"); + trace ( "too much stuffing\n"); break; } } @@ -309,7 +312,7 @@ static int demux (uint8_t * buf, uint8_t * end, int flags) break; default: if (header[3] < 0xb9) { - fprintf (stderr, + trace ( "looks like a video stream, not system stream\n"); exit (1); } else { @@ -353,7 +356,7 @@ static void ts_loop (void) buf = buffer; for (; (nextbuf = buf + 188) <= end; buf = nextbuf) { if (*buf != 0x47) { - fprintf (stderr, "bad sync byte\n"); + trace ( "bad sync byte\n"); nextbuf = buf + 1; continue; } diff --git a/plugins/dca/parse.c b/plugins/dca/parse.c index c66a64ff..6a9225b0 100644 --- a/plugins/dca/parse.c +++ b/plugins/dca/parse.c @@ -46,6 +46,9 @@ #include "tables_fir.h" #include "tables_vq.h" +//#define trace(...) { fprintf (stderr, __VA_ARGS__); } +#define trace(fmt,...) + /* #define DEBUG */ #if defined(HAVE_MEMALIGN) && !defined(__cplusplus) @@ -520,7 +523,7 @@ static int dca_subframe_header (dca_state_t * state) if (state->bitalloc[j][k] > 26) { - fprintf (stderr, "bitalloc index [%i][%i] too big (%i)\n", + trace ("bitalloc index [%i][%i] too big (%i)\n", j, k, state->bitalloc[j][k]); return -1; } @@ -950,7 +953,7 @@ static int dca_subsubframe (dca_state_t * state) if (!state->debug_flag & 0x01) { - fprintf (stderr, "Stream with high frequencies VQ coding\n"); + trace ("Stream with high frequencies VQ coding\n"); state->debug_flag |= 0x01; } @@ -974,7 +977,7 @@ static int dca_subsubframe (dca_state_t * state) } else { - fprintf( stderr, "Didn't get subframe DSYNC\n" ); + trace( "Didn't get subframe DSYNC\n" ); } } @@ -1125,7 +1128,7 @@ int decode_blockcode( int code, int levels, int *values ) return 1; else { - fprintf (stderr, "ERROR: block code look-up failed\n"); + trace ("ERROR: block code look-up failed\n"); return 0; } } |