RIFF.pm (Image-ExifTool-12.57) | : | RIFF.pm (Image-ExifTool-12.58) | ||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
# 15) https://tech.ebu.ch/docs/tech/tech3306-2009.pdf | # 15) https://tech.ebu.ch/docs/tech/tech3306-2009.pdf | |||
# 16) https://sites.google.com/site/musicgapi/technical-documents/w av-file-format | # 16) https://sites.google.com/site/musicgapi/technical-documents/w av-file-format | |||
#------------------------------------------------------------------------------ | #------------------------------------------------------------------------------ | |||
package Image::ExifTool::RIFF; | package Image::ExifTool::RIFF; | |||
use strict; | use strict; | |||
use vars qw($VERSION $AUTOLOAD); | use vars qw($VERSION $AUTOLOAD); | |||
use Image::ExifTool qw(:DataAccess :Utils); | use Image::ExifTool qw(:DataAccess :Utils); | |||
$VERSION = '1.61'; | $VERSION = '1.62'; | |||
sub ConvertTimecode($); | sub ConvertTimecode($); | |||
sub ProcessSGLT($$$); | sub ProcessSGLT($$$); | |||
sub ProcessSLLT($$$); | sub ProcessSLLT($$$); | |||
sub ProcessLucas($$$); | sub ProcessLucas($$$); | |||
sub WriteRIFF($$); | sub WriteRIFF($$); | |||
# recognized RIFF variants | # recognized RIFF variants | |||
my %riffType = ( | my %riffType = ( | |||
'WAVE' => 'WAV', 'AVI ' => 'AVI', 'WEBP' => 'WEBP', | 'WAVE' => 'WAV', 'AVI ' => 'AVI', 'WEBP' => 'WEBP', | |||
skipping to change at line 1525 | skipping to change at line 1525 | |||
1 => 'FileSize', | 1 => 'FileSize', | |||
}, | }, | |||
Desire => { | Desire => { | |||
# check FrameCount because this calculation only applies | # check FrameCount because this calculation only applies | |||
# to audio-only files (eg. WAV) | # to audio-only files (eg. WAV) | |||
2 => 'FrameCount', | 2 => 'FrameCount', | |||
3 => 'VideoFrameCount', | 3 => 'VideoFrameCount', | |||
}, | }, | |||
# (can't calculate duration like this for compressed audio types) | # (can't calculate duration like this for compressed audio types) | |||
RawConv => q{ | RawConv => q{ | |||
return undef if $$self{VALUE}{FileType} =~ /^(LA|OFR|PAC|WV)$/; | return undef if $$self{FileType} =~ /^(LA|OFR|PAC|WV)$/; | |||
return(($val[0] and not ($val[2] or $val[3])) ? $val[1] / $val[0] : undef); | return(($val[0] and not ($val[2] or $val[3])) ? $val[1] / $val[0] : undef); | |||
}, | }, | |||
PrintConv => 'ConvertDuration($val)', | PrintConv => 'ConvertDuration($val)', | |||
}, | }, | |||
); | ); | |||
# add our composite tags | # add our composite tags | |||
Image::ExifTool::AddCompositeTags('Image::ExifTool::RIFF'); | Image::ExifTool::AddCompositeTags('Image::ExifTool::RIFF'); | |||
#------------------------------------------------------------------------------ | #------------------------------------------------------------------------------ | |||
skipping to change at line 1998 | skipping to change at line 1998 | |||
} else { | } else { | |||
# minimal support for a few obscure lossless audio formats... | # minimal support for a few obscure lossless audio formats... | |||
return 0 unless $buff =~ /^(LA0[234]|OFR |LPAC|wvpk)/ and $raf->Read($bu f2, 1024); | return 0 unless $buff =~ /^(LA0[234]|OFR |LPAC|wvpk)/ and $raf->Read($bu f2, 1024); | |||
$type = $riffType{$1}; | $type = $riffType{$1}; | |||
$buff .= $buf2; | $buff .= $buf2; | |||
return 0 unless $buff =~ /WAVE(.{4})?fmt /sg and $raf->Seek(pos($buff) - 4, 0); | return 0 unless $buff =~ /WAVE(.{4})?fmt /sg and $raf->Seek(pos($buff) - 4, 0); | |||
} | } | |||
$$raf{NoBuffer} = 1 if $et->Options('FastScan'); # disable buffering in Fast Scan mode | $$raf{NoBuffer} = 1 if $et->Options('FastScan'); # disable buffering in Fast Scan mode | |||
$mime = $riffMimeType{$type} if $type; | $mime = $riffMimeType{$type} if $type; | |||
$et->SetFileType($type, $mime); | $et->SetFileType($type, $mime); | |||
$$et{VALUE}{FileType} .= ' (RF64)' if $rf64; | $$et{VALUE}{FileType} .= ' (RF64)' if $rf64 and $$et{VALUE}{FileType}; | |||
$$et{RIFFStreamType} = ''; # initialize stream type | $$et{RIFFStreamType} = ''; # initialize stream type | |||
$$et{RIFFStreamCodec} = []; # initialize codec array | $$et{RIFFStreamCodec} = []; # initialize codec array | |||
SetByteOrder('II'); | SetByteOrder('II'); | |||
my $riffEnd = Get32u(\$buff, 4) + 8; | my $riffEnd = Get32u(\$buff, 4) + 8; | |||
$riffEnd += $riffEnd & 0x01; # (account for padding) | $riffEnd += $riffEnd & 0x01; # (account for padding) | |||
my $tagTbl = GetTagTable('Image::ExifTool::RIFF::Main'); | my $tagTbl = GetTagTable('Image::ExifTool::RIFF::Main'); | |||
my $pos = 12; | my $pos = 12; | |||
# | # | |||
# Read chunks in RIFF image | # Read chunks in RIFF image | |||
# | # | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added |