forked from len0rd/rockbox
songdb.pl doesn't crash when trying to parse Ogg FLAC or Ogg Speex files now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7150 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
f580941b5a
commit
006f7045be
1 changed files with 11 additions and 5 deletions
|
@ -64,10 +64,11 @@ sub load
|
||||||
$data{'filename'} = $file;
|
$data{'filename'} = $file;
|
||||||
$data{'fileHandle'} = \*FILE;
|
$data{'fileHandle'} = \*FILE;
|
||||||
|
|
||||||
_init(\%data);
|
if (_init(\%data)) {
|
||||||
_loadInfo(\%data);
|
_loadInfo(\%data);
|
||||||
_loadComments(\%data);
|
_loadComments(\%data);
|
||||||
_calculateTrackLength(\%data);
|
_calculateTrackLength(\%data);
|
||||||
|
}
|
||||||
|
|
||||||
close FILE;
|
close FILE;
|
||||||
|
|
||||||
|
@ -92,8 +93,12 @@ sub info
|
||||||
sub comment_tags
|
sub comment_tags
|
||||||
{
|
{
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
|
if ( $self && $self->{'COMMENT_KEYS'} ) {
|
||||||
|
return @{$self->{'COMMENT_KEYS'}};
|
||||||
|
}
|
||||||
|
|
||||||
return @{$self->{'COMMENT_KEYS'}};
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub comment
|
sub comment
|
||||||
|
@ -160,6 +165,7 @@ sub _init
|
||||||
}
|
}
|
||||||
|
|
||||||
$data->{'startInfoHeader'} = $byteCount;
|
$data->{'startInfoHeader'} = $byteCount;
|
||||||
|
return 1; # Success
|
||||||
}
|
}
|
||||||
|
|
||||||
sub _checkHeader
|
sub _checkHeader
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue