forwarded 295240 Andrew Molloy <[EMAIL PROTECTED]>
thanks

Hello Andrew,

a user of the Debian package of Ogg::Vorbis::Header::PurePerl, which I
maintain, reported a bug to the Debian bugtracking system. The bugreport
follows.

Regards,
Florian

On Mon, Feb 14, 2005 at 12:05:55PM -0500, Jeff King wrote:
> Package: libogg-vorbis-header-pureperl-perl
> Version: 0.07-1
> Severity: wishlist
> Tags: patch
> 
> I recently wrote a program to extract comments from a large number of
> Ogg files. Running a profiler, I found that a significant portion of the
> time was spent in _calculateTrackLength (62% if the disk cache is
> primed). As it turns out, this step is irrelevant to reading the comment
> fields, and it would be nice to avoid it.
> 
> I am attaching a patch which provides a named options hash to the object
> constructor. You can specify the option 'notracklength' to avoid the
> track length calculation. Existing users will see the same behavior if
> they provide no options.
> 
> I didn't update the pod documentation. Usage is something like:
>   my $ogg = Ogg::Vorbis::Header::PurePerl->new($file, 
>                                                {notracklength => 1});
> 
> The patch also cleans up an apparently unused option to the load
> constructor.
> 
> -- System Information:
> Debian Release: 3.1
>   APT prefers unstable
>   APT policy: (500, 'unstable')
> Architecture: i386 (i686)
> Kernel: Linux 2.6.10-1-k7-smp
> Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
> 
> Versions of packages libogg-vorbis-header-pureperl-perl depends on:
> ii  perl                          5.8.4-6    Larry Wall's Practical 
> Extraction 
> 
> -- no debconf information

> --- PurePerl.pm.orig  2005-02-14 12:04:38.000000000 -0500
> +++ PurePerl.pm       2005-02-14 12:04:25.000000000 -0500
> @@ -12,15 +12,16 @@
>  {
>      my $class = shift;
>      my $file = shift;
> +    my $opts = shift;
>  
> -    return load($class, $file);
> +    return load($class, $file, $opts);
>  }
>  
>  sub load 
>  {
>      my $class    = shift;
>      my $file     = shift;
> -    my $from_new = shift;
> +    my $opts     = shift || {};
>      my %data;
>      my $self;
>  
> @@ -59,7 +60,7 @@
>      _init(\%data);
>      _loadInfo(\%data);
>      _loadComments(\%data);
> -    _calculateTrackLength(\%data);
> +    _calculateTrackLength(\%data) unless $opts->{notracklength};
>  
>      close FILE;
>  

Attachment: signature.asc
Description: Digital signature

Reply via email to