Audio-M4P
view release on metacpan or search on metacpan
0.42 Sun 6 Jan 2008
- another memory leak patch for Perl 5.10, and a test for this
0.41 Sat 8 Dec 2007
- corrected a skip in a test file (replaced use with require)
- utf8::encode requires perl 5.8, so unfortunately that's what we will need
0.40 Fri 7 Dec 2007
- improved circular reference handling with the 'use_weak_ref' option
in Tree::Simple and some weakening of the Atom's internal circular refs
0.39 Thu 6 Dec 2007
- more memory leak fix work, and
- add some utf8 data fixes, thanks to Christopher K. for the patches
0.38 Thu 27 Sep 2007
- fixed a circular reference memory leak in the parse tree,
thanks to Paul S. for finding the bug
0.37 Thu 5 July 2007
lib/Audio/M4P/Atom.pm view on Meta::CPAN
package Audio::M4P::Atom;
require 5.006;
use strict;
use warnings;
use Carp;
our $VERSION = '0.54';
use Scalar::Util 'weaken';
use Tree::Simple 'use_weak_refs';
use Tree::Simple::Visitor;
use Tree::Simple::View::HTML;
# see http://www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt
my %container_atom_types = (
aaid => 1,
akid => 1,
'©alb' => 1,
lib/Audio/M4P/Atom.pm view on Meta::CPAN
# begin class methods
sub new {
my ( $class, %args ) = @_;
my $self = \%args;
bless( $self, $class );
$self->{node} = Tree::Simple->new($self);
if( ref $self->{parent} ) {
$self->{parent}->addChild( $self->{node} );
weaken $self->{node};
weaken $self->{parent};
}
else {
$self->{parent} = 0;
}
if( ref $self->{rbuf} ) {
weaken $self->{rbuf};
$self->read_buffer( $self->{read_buffer_position} )
if exists $self->{read_buffer_position};
}
return $self;
}
sub DESTROY {
my($self) = @_;
delete $self->{parent};
delete $self->{rbuf};
lib/Audio/M4P/QuickTime.pm view on Meta::CPAN
package Audio::M4P::QuickTime;
require 5.008;
use strict;
use warnings;
use Carp;
use Scalar::Util 'weaken';
our $VERSION = '0.57';
use Audio::M4P::Atom;
#-------------- useful hashes and arrays ------------------------------------#
our %meta_info_types = (
aART => 1, # album artist
aaid => 1, # album artist
'©alb' => 1, # album
lib/Audio/M4P/QuickTime.pm view on Meta::CPAN
my ($self) = @_;
$self->{atom_count} = 0;
$self->{root} = new Audio::M4P::Atom(
rbuf => \$self->{buffer},
type => 'file',
size => length $self->{buffer},
read_buffer_position => 0,
offset => 8,
parent => 0,
);
weaken $self->{root};
my $fsize = length $self->{buffer};
print "Buffer size is $fsize\n" if $self->{DEBUG};
$self->ParseMP4Container( $self->{root}->node, 0, $fsize );
print "Found $self->{atom_count} atoms.\n" if $self->{DEBUG};
$self->DumpTree( $self->{DEBUGDUMPFILE} ) if $self->{DEBUG} > 1;
}
sub WriteFile {
my ( $self, $outfile ) = @_;
open( my $outfh, '>', $outfile ) or croak "Cannot open output $outfile: $!";
( run in 0.424 second using v1.01-cache-2.11-cpan-65fba6d93b7 )