| 1 | #------------------------------------------------------------------------------ | ||||||||||||||||||||||||||||
| 2 | # File: Ogg.pm | ||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||
| 4 | # Description: Read Ogg meta information | ||||||||||||||||||||||||||||
| 5 | # | ||||||||||||||||||||||||||||
| 6 | # Revisions: 2011/07/13 - P. Harvey Created (split from Vorbis.pm) | ||||||||||||||||||||||||||||
| 7 | # 2016/07/14 - PH Added Ogg Opus support | ||||||||||||||||||||||||||||
| 8 | # | ||||||||||||||||||||||||||||
| 9 | # References: 1) http://www.xiph.org/vorbis/doc/ | ||||||||||||||||||||||||||||
| 10 | # 2) http://flac.sourceforge.net/ogg_mapping.html | ||||||||||||||||||||||||||||
| 11 | # 3) http://www.theora.org/doc/Theora.pdf | ||||||||||||||||||||||||||||
| 12 | #------------------------------------------------------------------------------ | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | package Image::ExifTool::Ogg; | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 17 | 3 | ▶ | use vars qw($VERSION); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 18 | 3 | ▶ | use Image::ExifTool qw(:DataAccess :Utils); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 3 | $VERSION = '1.04'; | |||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 3 | my $MAX_PACKETS = 2; # maximum packets to scan from each stream at start of file | |||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | # Information types recognized in Ogg files | ||||||||||||||||||||||||||||
| 25 | 3 | %Image::ExifTool::Ogg::Main = ( | |||||||||||||||||||||||||||
| 26 | NOTES => q{ | ||||||||||||||||||||||||||||
| 27 | ExifTool extracts the following types of information from Ogg files. See | ||||||||||||||||||||||||||||
| 28 | L<http://www.xiph.org/vorbis/doc/> for the Ogg specification. | ||||||||||||||||||||||||||||
| 29 | }, | ||||||||||||||||||||||||||||
| 30 | # (these are for documentation purposes only, and aren't used by the code below) | ||||||||||||||||||||||||||||
| 31 | vorbis => { SubDirectory => { TagTable => 'Image::ExifTool::Vorbis::Main' } }, | ||||||||||||||||||||||||||||
| 32 | theora => { SubDirectory => { TagTable => 'Image::ExifTool::Theora::Main' } }, | ||||||||||||||||||||||||||||
| 33 | Opus => { SubDirectory => { TagTable => 'Image::ExifTool::Opus::Main' } }, | ||||||||||||||||||||||||||||
| 34 | FLAC => { SubDirectory => { TagTable => 'Image::ExifTool::FLAC::Main' } }, | ||||||||||||||||||||||||||||
| 35 | ID3 => { SubDirectory => { TagTable => 'Image::ExifTool::ID3::Main' } }, | ||||||||||||||||||||||||||||
| 36 | ); | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | #------------------------------------------------------------------------------ | ||||||||||||||||||||||||||||
| 39 | # Process Ogg packet | ||||||||||||||||||||||||||||
| 40 | # Inputs: 0) ExifTool object ref, 1) data ref | ||||||||||||||||||||||||||||
| 41 | # Returns: 1 on success | ||||||||||||||||||||||||||||
| 42 | sub ProcessPacket($$) | ||||||||||||||||||||||||||||
| 43 | 4 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
ProcessPacket: called CC=12 SCAR=26.6
Pod
undocumented
| |||||||||||||||||||||||||||||
| 44 | 4 | my ($et, $dataPt) = @_; | |||||||||||||||||||||||||||
| 45 | 4 | my $rtnVal = 0; | |||||||||||||||||||||||||||
| 46 | 4 | ▶ | if ($$dataPt =~ /^(.)(vorbis|theora)/s or $$dataPt =~ /^(OpusHead|OpusTags)/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$$dataPt =~ /^(.)(vorbis|theora)/s or $$dataPt =~ /^(OpusHead|OpusTags)/
MC/DC0%0/2
$$dataPt =~ /^(.)(vorbis|theora)/s or $$dataPt =~ /^(OpusHead|OpusTags)/
$$dataPt =~ /^(.)(vorbis|theora)/s
$$dataPt =~ /^(OpusHead|OpusTags)/
Truth table66%2/3
A or B
A= $$dataPt =~ /^(.)(vorbis|theora)/sB= $$dataPt =~ /^(OpusHead|OpusTags)/
| |||||||||||||||||||||||||||||
| 47 | 4 | ▶ | my ($tag, $type, $pos) = $2 ? (ord($1), ucfirst($2), 7) : ($1, 'Opus', 8); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 48 | # this is an OGV file if it contains Theora video | ||||||||||||||||||||||||||||
| 49 | 4 | ▶ | $et->OverrideFileType('OGV') if $type eq 'Theora' and $$et{FILE_TYPE} eq 'OGG'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$type eq "Theora" and $et->{"FILE_TYPE"} eq "OGG"
MC/DC0%0/2
$type eq "Theora" and $et->{"FILE_TYPE"} eq "OGG"
$type eq "Theora"
$et->{"FILE_TYPE"} eq "OGG"
Truth table33%1/3
A and B
A= $type eq "Theora"B= $et->{"FILE_TYPE"} eq "OGG"
| |||||||||||||||||||||||||||||
| 50 | 4 | ▶ | $et->OverrideFileType('OPUS') if $type eq 'Opus' and $$et{FILE_TYPE} eq 'OGG'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$type eq "Opus" and $et->{"FILE_TYPE"} eq "OGG"
MC/DC50%1/2
$type eq "Opus" and $et->{"FILE_TYPE"} eq "OGG"
$type eq "Opus"
$et->{"FILE_TYPE"} eq "OGG"
Truth table66%2/3
A and B
A= $type eq "Opus"B= $et->{"FILE_TYPE"} eq "OGG"
| |||||||||||||||||||||||||||||
| 51 | 4 | my $tagTablePtr = GetTagTable("Image::ExifTool::${type}::Main"); | |||||||||||||||||||||||||||
| 52 | 4 | my $tagInfo = $et->GetTagInfo($tagTablePtr, $tag); | |||||||||||||||||||||||||||
| 53 | 4 | ▶ | return 0 unless $tagInfo and $$tagInfo{SubDirectory}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$tagInfo and $tagInfo->{"SubDirectory"}
MC/DC0%0/2
$tagInfo and $tagInfo->{"SubDirectory"}
$tagInfo
$tagInfo->{"SubDirectory"}
Truth table33%1/3
A and B
A= $tagInfoB= $tagInfo->{"SubDirectory"}
| |||||||||||||||||||||||||||||
| 54 | 4 | my $subdir = $$tagInfo{SubDirectory}; | |||||||||||||||||||||||||||
| 55 | my %dirInfo = ( | ||||||||||||||||||||||||||||
| 56 | DataPt => $dataPt, | ||||||||||||||||||||||||||||
| 57 | DirName => $$tagInfo{Name}, | ||||||||||||||||||||||||||||
| 58 | 4 | DirStart => $pos, | |||||||||||||||||||||||||||
| 59 | ); | ||||||||||||||||||||||||||||
| 60 | 4 | my $table = GetTagTable($$subdir{TagTable}); | |||||||||||||||||||||||||||
| 61 | # set group1 so Theoris comments can be distinguised from Vorbis comments | ||||||||||||||||||||||||||||
| 62 | 4 | ▶ | $$et{SET_GROUP1} = $type if $type eq 'Theora'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 63 | 4 | ▶ | SetByteOrder($$subdir{ByteOrder}) if $$subdir{ByteOrder}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 64 | 4 | $rtnVal = $et->ProcessDirectory(\%dirInfo, $table); | |||||||||||||||||||||||||||
| 65 | 4 | SetByteOrder('II'); | |||||||||||||||||||||||||||
| 66 | 4 | delete $$et{SET_GROUP1}; | |||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||
| 68 | 4 | return $rtnVal; | |||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | #------------------------------------------------------------------------------ | ||||||||||||||||||||||||||||
| 72 | # Extract information from an Ogg file | ||||||||||||||||||||||||||||
| 73 | # Inputs: 0) ExifTool object reference, 1) dirInfo reference | ||||||||||||||||||||||||||||
| 74 | # Returns: 1 on success, 0 if this wasn't a valid Ogg file | ||||||||||||||||||||||||||||
| 75 | sub ProcessOGG($$) | ||||||||||||||||||||||||||||
| 76 | 3 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
ProcessOGG: called CC=39 SCAR=41.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 77 | 3 | my ($et, $dirInfo) = @_; | |||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | # must first check for leading/trailing ID3 information | ||||||||||||||||||||||||||||
| 80 | 3 | ▶ | unless ($$et{DoneID3}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 81 | 3 | require Image::ExifTool::ID3; | |||||||||||||||||||||||||||
| 82 | 3 | ▶ | Image::ExifTool::ID3::ProcessID3($et, $dirInfo) and return 1; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||
| 84 | 3 | my $raf = $$dirInfo{RAF}; | |||||||||||||||||||||||||||
| 85 | 3 | my $verbose = $et->Options('Verbose'); | |||||||||||||||||||||||||||
| 86 | 3 | my $out = $et->Options('TextOut'); | |||||||||||||||||||||||||||
| 87 | 3 | my ($success, $page, $packets, $streams, $stream) = (0,0,0,0,''); | |||||||||||||||||||||||||||
| 88 | 3 | my ($buff, $flag, %val, $numFlac, %streamPage); | |||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | 3 | for (;;) { | |||||||||||||||||||||||||||
| 91 | # must read ahead to next page to see if it is a continuation | ||||||||||||||||||||||||||||
| 92 | # (this code would be a lot simpler if the continuation flag | ||||||||||||||||||||||||||||
| 93 | # was on the leading instead of the trailing page!) | ||||||||||||||||||||||||||||
| 94 | 10 | ▶ | if ($raf and $raf->Read($buff, 28) == 28) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$raf and $raf->Read($buff, 28) == 28
MC/DC50%1/2
$raf and $raf->Read($buff, 28) == 28
$raf
$raf->Read($buff, 28) == 28
Truth table66%2/3
A and B
A= $rafB= $raf->Read($buff, 28) == 28
| |||||||||||||||||||||||||||||
| 95 | # validate magic number | ||||||||||||||||||||||||||||
| 96 | 9 | ▶ | unless ($buff =~ /^OggS/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 97 | 0 | ▶ | $success and $et->Warn('Lost synchronization'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 98 | 0 | last; | |||||||||||||||||||||||||||
| 99 | } | ||||||||||||||||||||||||||||
| 100 | 9 | ▶ | unless ($success) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 101 | # set file type and initialize on first page | ||||||||||||||||||||||||||||
| 102 | 3 | $success = 1; | |||||||||||||||||||||||||||
| 103 | 3 | $et->SetFileType(); | |||||||||||||||||||||||||||
| 104 | 3 | SetByteOrder('II'); | |||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||
| 106 | 9 | $flag = Get8u(\$buff, 5); # page flag | |||||||||||||||||||||||||||
| 107 | 9 | $stream = Get32u(\$buff, 14); # stream serial number | |||||||||||||||||||||||||||
| 108 | 9 | ▶ | if ($flag & 0x02) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 109 | 3 | ++$streams; # count start-of-stream pages | |||||||||||||||||||||||||||
| 110 | 3 | $streamPage{$stream} = $page = 0; | |||||||||||||||||||||||||||
| 111 | } else { | ||||||||||||||||||||||||||||
| 112 | 6 | $page = $streamPage{$stream}; | |||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||
| 114 | 9 | ▶ | ++$packets unless $flag & 0x01; # keep track of packet count | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 115 | } else { | ||||||||||||||||||||||||||||
| 116 | # all done unless we have to process our last packet | ||||||||||||||||||||||||||||
| 117 | 1 | ▶ | last unless %val; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 118 | 1 | ($stream) = sort keys %val; # take a stream | |||||||||||||||||||||||||||
| 119 | 1 | $flag = 0; # no continuation | |||||||||||||||||||||||||||
| 120 | 1 | undef $raf; # flag for done reading | |||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||
| 123 | 10 | ▶ | if (defined $numFlac) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 124 | # stop to process FLAC headers if we hit the end of file | ||||||||||||||||||||||||||||
| 125 | 2 | ▶ | last unless $raf; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 126 | 1 | --$numFlac; # one less header packet to read | |||||||||||||||||||||||||||
| 127 | } else { | ||||||||||||||||||||||||||||
| 128 | # can finally process previous packet from this stream | ||||||||||||||||||||||||||||
| 129 | # unless this is a continuation page | ||||||||||||||||||||||||||||
| 130 | 8 | ▶ | if (defined $val{$stream} and not $flag & 0x01) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $val{$stream} and not $flag & 1
MC/DC100%2/2
defined $val{$stream} and not $flag & 1
defined $val{$stream}
not $flag & 1
Truth table100%3/3
A and not(B)
A= defined $val{$stream}B= not $flag & 1
| |||||||||||||||||||||||||||||
| 131 | 4 | ProcessPacket($et, \$val{$stream}); | |||||||||||||||||||||||||||
| 132 | 4 | delete $val{$stream}; | |||||||||||||||||||||||||||
| 133 | # only read the first $MAX_PACKETS packets from each stream | ||||||||||||||||||||||||||||
| 134 | 4 | ▶ | if ($packets > $MAX_PACKETS * $streams or not defined $raf) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$packets > $MAX_PACKETS * $streams or not defined $raf
MC/DC50%1/2
$packets > $MAX_PACKETS * $streams or not defined $raf
$packets > $MAX_PACKETS * $streams
not defined $raf
Truth table66%2/3
A or not(B)
A= $packets > $MAX_PACKETS * $streamsB= not defined $raf
| |||||||||||||||||||||||||||||
| 135 | 2 | ▶ | last unless %val; # all done (success!) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||
| 138 | # stop processing Ogg if we have scanned enough packets | ||||||||||||||||||||||||||||
| 139 | 6 | ▶ | last if $packets > $MAX_PACKETS * $streams and not %val; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$packets > $MAX_PACKETS * $streams and not %val
MC/DC0%0/2
$packets > $MAX_PACKETS * $streams and not %val
$packets > $MAX_PACKETS * $streams
not %val
Truth table33%1/3
A and not(B)
A= $packets > $MAX_PACKETS * $streamsB= not %val
| |||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||
| 142 | # continue processing the current page | ||||||||||||||||||||||||||||
| 143 | 7 | my $pageNum = Get32u(\$buff, 18); # page sequence number | |||||||||||||||||||||||||||
| 144 | 7 | my $nseg = Get8u(\$buff, 26); # number of segments | |||||||||||||||||||||||||||
| 145 | # calculate total data length | ||||||||||||||||||||||||||||
| 146 | 7 | my $dataLen = Get8u(\$buff, 27); | |||||||||||||||||||||||||||
| 147 | 7 | ▶ | if ($nseg) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 148 | 7 | ▶ | last unless $raf; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 149 | 7 | ▶ | $raf->Read($buff, $nseg-1) == $nseg-1 or last; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 150 | 7 | my @segs = unpack('C*', $buff); | |||||||||||||||||||||||||||
| 151 | # could check that all these (but the last) are 255... | ||||||||||||||||||||||||||||
| 152 | 7 | foreach (@segs) { $dataLen += $_ } | |||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||
| 154 | 7 | ▶ | if (defined $page) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 155 | 7 | ▶ | if ($page == $pageNum) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 156 | 7 | $streamPage{$stream} = ++$page; | |||||||||||||||||||||||||||
| 157 | } else { | ||||||||||||||||||||||||||||
| 158 | 0 | $et->Warn('Missing page(s) in Ogg file'); | |||||||||||||||||||||||||||
| 159 | 0 | undef $page; | |||||||||||||||||||||||||||
| 160 | 0 | delete $streamPage{$stream}; | |||||||||||||||||||||||||||
| 161 | } | ||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||
| 163 | # read page data | ||||||||||||||||||||||||||||
| 164 | 7 | ▶ | last unless $raf and $raf->Read($buff, $dataLen) == $dataLen; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$raf and $raf->Read($buff, $dataLen) == $dataLen
MC/DC0%0/2
$raf and $raf->Read($buff, $dataLen) == $dataLen
$raf
$raf->Read($buff, $dataLen) == $dataLen
Truth table33%1/3
A and B
A= $rafB= $raf->Read($buff, $dataLen) == $dataLen
| |||||||||||||||||||||||||||||
| 165 | 7 | ▶ | if ($verbose > 1) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 166 | 0 | printf $out "Page %d, stream 0x%x, flag 0x%x (%d bytes)\n", | |||||||||||||||||||||||||||
| 167 | $pageNum, $stream, $flag, $dataLen; | ||||||||||||||||||||||||||||
| 168 | 0 | $et->VerboseDump(\$buff, DataPos => $raf->Tell() - $dataLen); | |||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||
| 170 | 7 | ▶ | if (defined $val{$stream}) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 171 | 2 | $val{$stream} .= $buff; # add this continuation page | |||||||||||||||||||||||||||
| 172 | } elsif (not $flag & 0x01) { # ignore remaining pages of a continued packet | ||||||||||||||||||||||||||||
| 173 | # ignore the first page of any packet we aren't parsing | ||||||||||||||||||||||||||||
| 174 | 5 | ▶ | if ($buff =~ /^(.(vorbis|theora)|Opus(Head|Tags))/s) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 175 | 4 | $val{$stream} = $buff; # save this page | |||||||||||||||||||||||||||
| 176 | } elsif ($buff =~ /^\x7fFLAC..(..)/s) { | ||||||||||||||||||||||||||||
| 177 | 1 | $numFlac = unpack('n',$1); | |||||||||||||||||||||||||||
| 178 | 1 | $val{$stream} = substr($buff, 9); | |||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||
| 181 | 7 | ▶ | if (defined $numFlac) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 182 | # stop to process FLAC headers if we have them all | ||||||||||||||||||||||||||||
| 183 | 2 | ▶ | last if $numFlac <= 0; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 184 | ▶ | } elsif (defined $val{$stream} and $flag & 0x04) { | |||||||||||||||||||||||||||
|
Condition33%1/3
defined $val{$stream} and $flag & 4
MC/DC0%0/2
defined $val{$stream} and $flag & 4
defined $val{$stream}
$flag & 4
Truth table33%1/3
A and B
A= defined $val{$stream}B= $flag & 4
| |||||||||||||||||||||||||||||
| 185 | # process Ogg packet now if end-of-stream bit is set | ||||||||||||||||||||||||||||
| 186 | 0 | ProcessPacket($et, \$val{$stream}); | |||||||||||||||||||||||||||
| 187 | 0 | delete $val{$stream}; | |||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||
| 189 | } | ||||||||||||||||||||||||||||
| 190 | 3 | ▶ | if (defined $numFlac and defined $val{$stream}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $numFlac and defined $val{$stream}
MC/DC50%1/2
defined $numFlac and defined $val{$stream}
defined $numFlac
defined $val{$stream}
Truth table66%2/3
A and B
A= defined $numFlacB= defined $val{$stream}
| |||||||||||||||||||||||||||||
| 191 | # process FLAC headers as if it was a complete FLAC file | ||||||||||||||||||||||||||||
| 192 | 1 | require Image::ExifTool::FLAC; | |||||||||||||||||||||||||||
| 193 | 1 | my %dirInfo = ( RAF => File::RandomAccess->new(\$val{$stream}) ); | |||||||||||||||||||||||||||
| 194 | 1 | Image::ExifTool::FLAC::ProcessFLAC($et, \%dirInfo); | |||||||||||||||||||||||||||
| 195 | } | ||||||||||||||||||||||||||||
| 196 | 3 | return $success; | |||||||||||||||||||||||||||
| 197 | } | ||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||
| 199 | 3 | 1; # end | |||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||
| 201 | __END__ | ||||||||||||||||||||||||||||