--- amv.pl 2007/07/19 20:49:06 4 +++ amv.pl 2007/07/19 21:16:30 7 @@ -3,6 +3,10 @@ # amv.pl # # 07/19/07 19:21:39 CEST Dobrica Pavlinusic +# +# Various useful links used to produce this: +# http://www.moviecodec.com/topics/15431p1.html +# http://en.wikipedia.org/wiki/RIFF_(File_format) use strict; @@ -29,8 +33,10 @@ # calculate number of characters for offset #my $d = length( sprintf("%x",length($bytes)) ); my $d = 4; + my $prefix = '#.'; while ( $hex =~ s/^((?:\w\w\s){1,16})// ) { - 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 ); + $prefix = '##'; if ( length($ascii) >= 16 ) { $ascii = substr( $ascii, 16 ); $o += 16; @@ -53,7 +59,7 @@ hex_dump( $bytes ); if ( $bytes eq 'AMV_END_' ) { - warn "## end of file marker AMV_END_\n"; + warn "> end of file marker AMV_END_\n"; $d->{eof}++; return; } @@ -75,7 +81,7 @@ if ( $expected_len ) { confess "expected $expected_len bytes for $part got $len" if $len != $expected_len; } - printf ">>> %s | %d 0x%x bytes\n", $part, $len, $len; + printf ">> %s - %d 0x%x bytes\n", $part, $len, $len; x($len) if $skip; return $len; }