/[amv]/amv.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /amv.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4 by dpavlin, Thu Jul 19 20:49:06 2007 UTC revision 6 by dpavlin, Thu Jul 19 20:56:25 2007 UTC
# Line 29  sub hex_dump { Line 29  sub hex_dump {
29          # calculate number of characters for offset          # calculate number of characters for offset
30          #my $d = length( sprintf("%x",length($bytes)) );          #my $d = length( sprintf("%x",length($bytes)) );
31          my $d = 4;          my $d = 4;
32            my $prefix = '#.';
33          while ( $hex =~ s/^((?:\w\w\s){1,16})// ) {          while ( $hex =~ s/^((?:\w\w\s){1,16})// ) {
34                  printf "## %0${d}x | %-48s| %s\n", $o, $1, substr( $ascii, 0, 16 );                  printf "$prefix %0${d}x | %-48s| %s\n", $o, $1, substr( $ascii, 0, 16 );
35                    $prefix = '##';
36                  if ( length($ascii) >= 16 ) {                  if ( length($ascii) >= 16 ) {
37                          $ascii = substr( $ascii, 16 );                          $ascii = substr( $ascii, 16 );
38                          $o += 16;                          $o += 16;
# Line 53  sub x { Line 55  sub x {
55          hex_dump( $bytes );          hex_dump( $bytes );
56    
57          if ( $bytes eq 'AMV_END_' ) {          if ( $bytes eq 'AMV_END_' ) {
58                  warn "## end of file marker AMV_END_\n";                  warn "> end of file marker AMV_END_\n";
59                  $d->{eof}++;                  $d->{eof}++;
60                  return;                  return;
61          }          }
# Line 75  sub next_part { Line 77  sub next_part {
77          if ( $expected_len ) {          if ( $expected_len ) {
78                  confess "expected $expected_len bytes for $part got $len" if $len != $expected_len;                  confess "expected $expected_len bytes for $part got $len" if $len != $expected_len;
79          }          }
80          printf ">>> %s | %d 0x%x bytes\n", $part, $len, $len;          printf ">> %s - %d 0x%x bytes\n", $part, $len, $len;
81          x($len) if $skip;          x($len) if $skip;
82          return $len;          return $len;
83  }  }

Legend:
Removed from v.4  
changed lines
  Added in v.6

  ViewVC Help
Powered by ViewVC 1.1.26