r17493 - in /branches/upstream/libaudio-flac-header-perl/current: Changes Header.pm Header.xs META.yml Makefile.PL README t/pod-coverage.t

roberto at users.alioth.debian.org roberto at users.alioth.debian.org
Sun Mar 16 00:42:27 UTC 2008


Author: roberto
Date: Sun Mar 16 00:42:26 2008
New Revision: 17493

URL: http://svn.debian.org/wsvn/?sc=1&rev=17493
Log:
[svn-upgrade] Integrating new upstream version, libaudio-flac-header-perl (2.0)

Modified:
    branches/upstream/libaudio-flac-header-perl/current/Changes
    branches/upstream/libaudio-flac-header-perl/current/Header.pm
    branches/upstream/libaudio-flac-header-perl/current/Header.xs
    branches/upstream/libaudio-flac-header-perl/current/META.yml
    branches/upstream/libaudio-flac-header-perl/current/Makefile.PL
    branches/upstream/libaudio-flac-header-perl/current/README
    branches/upstream/libaudio-flac-header-perl/current/t/pod-coverage.t

Modified: branches/upstream/libaudio-flac-header-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libaudio-flac-header-perl/current/Changes?rev=17493&op=diff
==============================================================================
--- branches/upstream/libaudio-flac-header-perl/current/Changes (original)
+++ branches/upstream/libaudio-flac-header-perl/current/Changes Sun Mar 16 00:42:26 2008
@@ -1,4 +1,11 @@
 Revision history for Perl extension Audio::FLAC.
+
+2.0  Sat Feb 23 13:32:54 PST 2008
+	- RT #32691: Picture $type incorrectly defaults to 3 for valid input 0 - "Other"
+	- RT #32631: t/pod-coverage.t fails with Pod::Coverage 0.19
+	- RT #32693: Will not retrieve multiple pictures of the same picture type
+	- RT #32630: Test failure on several architectures (64-bit problems) XS
+	- Fixed compile warnings.
 
 1.9  Sun Dec 2  09:44:22 PST 2007
 	- Fix Test::Pod::Coverage usage.

Modified: branches/upstream/libaudio-flac-header-perl/current/Header.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libaudio-flac-header-perl/current/Header.pm?rev=17493&op=diff
==============================================================================
--- branches/upstream/libaudio-flac-header-perl/current/Header.pm (original)
+++ branches/upstream/libaudio-flac-header-perl/current/Header.pm Sun Mar 16 00:42:26 2008
@@ -1,11 +1,11 @@
 package Audio::FLAC::Header;
 
-# $Id: Header.pm 21 2007-12-02 18:01:56Z dsully $
+# $Id: Header.pm 22 2008-02-23 21:53:30Z dsully $
 
 use strict;
 use File::Basename;
 
-our $VERSION = '1.9';
+our $VERSION = '2.0';
 our $HAVE_XS = 0;
 
 # First four bytes of stream are always fLaC
@@ -164,7 +164,12 @@
 
 sub picture {
 	my $self = shift;
-	my $type = shift || 3; # front cover
+	my $type = shift;
+	   $type = 3 unless defined ($type); # defaults to front cover 
+
+	if ($type eq 'all') {
+		return $self->{'allpictures'} if exists($self->{'allpictures'});
+	}
 
 	# if the picture block exists, return it's content
 	return $self->{'picture'}->{$type} if exists($self->{'picture'}->{$type});
@@ -694,6 +699,10 @@
 	$self->{'picture'}->{$pictureType}->{'depth'}       = $depth;
 	$self->{'picture'}->{$pictureType}->{'colorIndex'}  = $colorIndex;
 	$self->{'picture'}->{$pictureType}->{'imageData'}   = $imageData;
+	$self->{'picture'}->{$pictureType}->{'pictureType'} = $pictureType;
+
+	# Create array of hashes with picture data from all the picture metadata blocks
+	push ( @{$self->{'allpictures'}}, {%{$self->{'picture'}->{$pictureType}}} );
 
 	return 1;
 }
@@ -964,6 +973,10 @@
 
 Defaults to type 3 - "Front Cover"
 
+When the passed variable is 'all', an array of hashes containing
+picture data from all PICTURE blocks is returned. Allows for multiple instances
+of the same picture type.
+
 =item * vendor_string( ) 
 
 Returns the vendor string.

Modified: branches/upstream/libaudio-flac-header-perl/current/Header.xs
URL: http://svn.debian.org/wsvn/branches/upstream/libaudio-flac-header-perl/current/Header.xs?rev=17493&op=diff
==============================================================================
--- branches/upstream/libaudio-flac-header-perl/current/Header.xs (original)
+++ branches/upstream/libaudio-flac-header-perl/current/Header.xs Sun Mar 16 00:42:26 2008
@@ -30,6 +30,9 @@
 
 #include <FLAC/all.h>
 
+/* for PRIu64 */
+#include <inttypes.h>
+
 #define FLACHEADERFLAG "fLaC"
 #define ID3HEADERFLAG  "ID3"
 
@@ -195,6 +198,19 @@
 		{
 			AV *cueArray = newAV();
 
+			/* 
+			 * buffer for decimal representations of uint64_t values
+			 *
+			 * newSVpvf() and sv_catpvf() can't handle 64-bit values 
+			 * in some cases, so we need to do the conversion "manually"
+			 * with sprintf() and the PRIu64 format macro for portability
+			 *
+			 * see http://bugs.debian.org/462249
+			 *
+			 * maximum string length: ceil(log10(2**64)) == 20 (+trailing \0)
+			 */
+			char decimal[21];
+
 			/* A lot of this comes from flac/src/share/grabbag/cuesheet.c */
 			const FLAC__StreamMetadata_CueSheet *cs;
 			unsigned track_num, index_num;
@@ -239,7 +255,8 @@
 						sv_catpvf(indexSV, "%02u:%02u:%02u\n", m, s, f);
 
 					} else {
-						sv_catpvf(indexSV, "%"UVuf"\n", track->offset + index->offset);
+						sprintf(decimal, "%"PRIu64, track->offset + index->offset);
+						sv_catpvf(indexSV, "%s\n", decimal);
 					}
 
 
@@ -247,9 +264,11 @@
 				}
 			}
 
-			av_push(cueArray, newSVpvf("REM FLAC__lead-in %"UVuf"\n", cs->lead_in));
-			av_push(cueArray, newSVpvf("REM FLAC__lead-out %u %"UVuf"\n", 
-				(unsigned)cs->tracks[track_num].number, cs->tracks[track_num].offset)
+			sprintf(decimal, "%"PRIu64, cs->lead_in);
+			av_push(cueArray, newSVpvf("REM FLAC__lead-in %s\n", decimal));
+			sprintf(decimal, "%"PRIu64, cs->tracks[track_num].offset);
+			av_push(cueArray, newSVpvf("REM FLAC__lead-out %u %s\n", 
+				(unsigned)cs->tracks[track_num].number, decimal)
 			);
 
 			my_hv_store(self, "cuesheet",  newRV_noinc((SV*) cueArray));
@@ -264,12 +283,12 @@
 			HV *picture = newHV();
 
 			my_hv_store(picture, "mimeType", newSVpv(block->data.picture.mime_type, 0));
-			my_hv_store(picture, "description", newSVpv(block->data.picture.description, 0));
+			my_hv_store(picture, "description", newSVpv((const char*)block->data.picture.description, 0));
 			my_hv_store(picture, "width", newSViv(block->data.picture.width));
 			my_hv_store(picture, "height", newSViv(block->data.picture.height));
 			my_hv_store(picture, "depth", newSViv(block->data.picture.depth));
 			my_hv_store(picture, "colorIndex", newSViv(block->data.picture.colors));
-			my_hv_store(picture, "imageData", newSVpv(block->data.picture.data, block->data.picture.data_length));
+			my_hv_store(picture, "imageData", newSVpv((const char*)block->data.picture.data, block->data.picture.data_length));
 
 			my_hv_store(
 				pictureContainer,
@@ -513,7 +532,6 @@
 	CODE:
 
 	FLAC__bool ok = true;
-	FLAC__bool needs_write = false;
 
 	HE *he;
 	HV *self = (HV *) SvRV(obj);

Modified: branches/upstream/libaudio-flac-header-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libaudio-flac-header-perl/current/META.yml?rev=17493&op=diff
==============================================================================
--- branches/upstream/libaudio-flac-header-perl/current/META.yml (original)
+++ branches/upstream/libaudio-flac-header-perl/current/META.yml Sun Mar 16 00:42:26 2008
@@ -14,4 +14,4 @@
     - t
 requires: 
   perl: 5.005
-version: 1.9
+version: 2.0

Modified: branches/upstream/libaudio-flac-header-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libaudio-flac-header-perl/current/Makefile.PL?rev=17493&op=diff
==============================================================================
--- branches/upstream/libaudio-flac-header-perl/current/Makefile.PL (original)
+++ branches/upstream/libaudio-flac-header-perl/current/Makefile.PL Sun Mar 16 00:42:26 2008
@@ -6,6 +6,7 @@
 license('perl');
 perl_version('5.005');
 all_from('Header.pm');
+requires_external_cc();
 
 if ($^O =~ /win32/i) {
 	cc_lib_links('FLAC_static');

Modified: branches/upstream/libaudio-flac-header-perl/current/README
URL: http://svn.debian.org/wsvn/branches/upstream/libaudio-flac-header-perl/current/README?rev=17493&op=diff
==============================================================================
--- branches/upstream/libaudio-flac-header-perl/current/README (original)
+++ branches/upstream/libaudio-flac-header-perl/current/README Sun Mar 16 00:42:26 2008
@@ -1,4 +1,4 @@
-Audio::FLAC version 1.9
+Audio::FLAC version .20
 =======================
 
 The README is used to introduce the module and provide instructions on
@@ -29,8 +29,10 @@
 Pure perl code Copyright (c) 2003-2004, Erik Reckase.
 
 Pure perl code Copyright (c) 2003-2007, Dan Sully & Slim Devices.
+Pure perl code Copyright (c) 2008, Dan Sully
 
 XS code Copyright (c) 2004-2007, Dan Sully & Slim Devices.
+XS code Copyright (c) 2008, Dan Sully
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself, either Perl version 5.8.2 or,

Modified: branches/upstream/libaudio-flac-header-perl/current/t/pod-coverage.t
URL: http://svn.debian.org/wsvn/branches/upstream/libaudio-flac-header-perl/current/t/pod-coverage.t?rev=17493&op=diff
==============================================================================
--- branches/upstream/libaudio-flac-header-perl/current/t/pod-coverage.t (original)
+++ branches/upstream/libaudio-flac-header-perl/current/t/pod-coverage.t Sun Mar 16 00:42:26 2008
@@ -6,4 +6,8 @@
 
 plan tests => 1;
 
-pod_coverage_ok("Audio::FLAC::Header", "Audio::FLAC::Header is covered" );
+pod_coverage_ok(
+    "Audio::FLAC::Header",
+    { also_private => ['dl_load_flags'] },
+    "Audio::FLAC::Header is covered"
+);




More information about the Pkg-perl-cvs-commits mailing list