~ubuntu-branches/ubuntu/lucid/mkvtoolnix/lucid

« back to all changes in this revision

Viewing changes to src/info/mkvinfo.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Clément Stenac
  • Date: 2007-05-17 11:18:27 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517111827-asq9dnnx1r9gjym2
Tags: 2.0.2-1
* New upstream bugfix version
* Use liblzo2, thanks to Peter Eisentraut (Closes:#423361)

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
   see the file COPYING for details
6
6
   or visit http://www.gnu.org/copyleft/gpl.html
7
7
 
8
 
   $Id: mkvinfo.cpp 3455 2007-01-10 13:13:23Z mosu $
 
8
   $Id: mkvinfo.cpp 3473 2007-01-16 17:10:58Z mosu $
9
9
 
10
10
   retrieves and displays information about a Matroska file
11
11
 
18
18
 
19
19
#include <errno.h>
20
20
#include <ctype.h>
 
21
#include <limits.h>
21
22
#include <stdarg.h>
22
23
#include <stdlib.h>
23
24
#include <stdio.h>
99
100
bool calc_checksums = false;
100
101
bool show_summary = false;
101
102
bool show_hexdump = false;
 
103
int hexdump_max_size = 16;
102
104
uint64_t tc_scale = TIMECODE_SCALE;
103
105
 
104
106
void
237
239
create_hexdump(const unsigned char *buf,
238
240
               int size) {
239
241
  string hex(" hexdump");
240
 
  int bmax = size >= 16 ? 16 : size, b;
 
242
  int bmax = size >= hexdump_max_size ? hexdump_max_size : size, b;
241
243
 
242
244
  for (b = 0; b < bmax; ++b)
243
245
    hex += mxsprintf(" %02x", buf[b]);
277
279
      show_summary = true;
278
280
    } else if ((args[i] == "-x") || (args[i] == "--hexdump"))
279
281
      show_hexdump = true;
280
 
    else if (file_name != "")
 
282
    else if ((args[i] == "-X") || (args[i] == "--full-hexdump")) {
 
283
      show_hexdump = true;
 
284
      hexdump_max_size = INT_MAX;
 
285
    } else if (file_name != "")
281
286
      mxerror("Only one input file is allowed.\n");
282
287
    else
283
288
      file_name = args[i];