r41549 - in /branches/upstream/libaudio-flac-decoder-perl/current: Changes Decoder.pm Decoder.xs MANIFEST META.yml README t/ test.flac test.pl

diocles-guest at users.alioth.debian.org diocles-guest at users.alioth.debian.org
Sat Aug 8 21:17:34 UTC 2009


Author: diocles-guest
Date: Sat Aug  8 21:17:27 2009
New Revision: 41549

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=41549
Log:
Revert r41547

Added:
    branches/upstream/libaudio-flac-decoder-perl/current/test.flac
      - copied unchanged from r41546, branches/upstream/libaudio-flac-decoder-perl/current/test.flac
    branches/upstream/libaudio-flac-decoder-perl/current/test.pl
      - copied unchanged from r41546, branches/upstream/libaudio-flac-decoder-perl/current/test.pl
Removed:
    branches/upstream/libaudio-flac-decoder-perl/current/t/
Modified:
    branches/upstream/libaudio-flac-decoder-perl/current/Changes
    branches/upstream/libaudio-flac-decoder-perl/current/Decoder.pm
    branches/upstream/libaudio-flac-decoder-perl/current/Decoder.xs
    branches/upstream/libaudio-flac-decoder-perl/current/MANIFEST
    branches/upstream/libaudio-flac-decoder-perl/current/META.yml
    branches/upstream/libaudio-flac-decoder-perl/current/README

Modified: branches/upstream/libaudio-flac-decoder-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libaudio-flac-decoder-perl/current/Changes?rev=41549&op=diff
==============================================================================
--- branches/upstream/libaudio-flac-decoder-perl/current/Changes (original)
+++ branches/upstream/libaudio-flac-decoder-perl/current/Changes Sat Aug  8 21:17:27 2009
@@ -1,7 +1,4 @@
 Revision history for Perl extension Audio::FLAC::Decoder.
-
-0.3  Mon Nov 24 14:33:34 PST 2008
-	* Patch from Mark Glines to update to the latest FLAC version.
 
 0.01  Fri Jan  3 17:33:52 2003
 	- original version; created by h2xs 1.21 with options

Modified: branches/upstream/libaudio-flac-decoder-perl/current/Decoder.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libaudio-flac-decoder-perl/current/Decoder.pm?rev=41549&op=diff
==============================================================================
--- branches/upstream/libaudio-flac-decoder-perl/current/Decoder.pm (original)
+++ branches/upstream/libaudio-flac-decoder-perl/current/Decoder.pm Sat Aug  8 21:17:27 2009
@@ -3,7 +3,7 @@
 use strict;
 use vars qw($VERSION);
 
-$VERSION = '0.3';
+$VERSION = '0.2';
 
 BOOT_XS: {
         # If I inherit DynaLoader then I inherit AutoLoader
@@ -105,7 +105,7 @@
 
 =head1 COPYRIGHT
 
-Copyright (c) 2004-2008, Dan Sully.  All Rights Reserved.
+Copyright (c) 2004, Dan Sully.  All Rights Reserved.
 
 This program is free software; you can redistribute it and/or modify it
 under the terms of the GNU General Public License as published by the
@@ -114,6 +114,6 @@
 
 =head1 SEE ALSO
 
-L<Audio::FLAC::Header>
+L<Audio::FLAC>
 
 =cut

Modified: branches/upstream/libaudio-flac-decoder-perl/current/Decoder.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libaudio-flac-decoder-perl/current/Decoder.xs?rev=41549&op=diff
==============================================================================
--- branches/upstream/libaudio-flac-decoder-perl/current/Decoder.xs (original)
+++ branches/upstream/libaudio-flac-decoder-perl/current/Decoder.xs Sat Aug  8 21:17:27 2009
@@ -49,32 +49,32 @@
 #define my_hv_fetch(a,b)     hv_fetch(a,b,strlen(b),0)
 
 /* Create some generic (and shorter) names for these types. */
-typedef FLAC__StreamDecoder decoder_t;
-typedef FLAC__StreamDecoderReadStatus read_status_t;
-
-#define FLACdecoder_new()                       FLAC__stream_decoder_new()
-#define FLACdecoder_init(a,b,c,d,e,f,g,h,i,j)   FLAC__stream_decoder_init_stream(a,b,c,d,e,f,g,h,i,j)
-#define FLACdecoder_process_metadata(x)         FLAC__stream_decoder_process_until_end_of_metadata(x)
-#define FLACdecoder_process_single(x)           FLAC__stream_decoder_process_single(x)
-#define FLACdecoder_finish(x)                   FLAC__stream_decoder_finish(x)
-#define FLACdecoder_delete(x)                   FLAC__stream_decoder_delete(x)
-#define FLACdecoder_set_read_callback(x, y)     FLAC__stream_decoder_set_read_callback(x, y)
-#define FLACdecoder_set_write_callback(x, y)    FLAC__stream_decoder_set_write_callback(x, y)
-#define FLACdecoder_set_metadata_callback(x, y) FLAC__stream_decoder_set_metadata_callback(x, y)
-#define FLACdecoder_set_error_callback(x, y)    FLAC__stream_decoder_set_error_callback(x, y)
-#define FLACdecoder_set_client_data(x, y)       FLAC__stream_decoder_set_client_data(x, y)
-#define FLACdecoder_set_seek_callback(x, y)     FLAC__stream_decoder_set_seek_callback(x, y)
-#define FLACdecoder_set_tell_callback(x, y)     FLAC__stream_decoder_set_tell_callback(x, y)
-#define FLACdecoder_set_length_callback(x, y)   FLAC__stream_decoder_set_length_callback(x, y)
-#define FLACdecoder_set_eof_callback(x, y)      FLAC__stream_decoder_set_eof_callback(x, y)
-#define FLACdecoder_seek_absolute(x, y)         FLAC__stream_decoder_seek_absolute(x, y)
-
-#define FLACdecoder_get_state(x)                FLAC__stream_decoder_get_state(x)
-#define FLACdecoder_get_channels(x)             FLAC__stream_decoder_get_channels(x)
-#define FLACdecoder_get_blocksize(x)		FLAC__stream_decoder_get_blocksize(x)
-#define FLACdecoder_get_sample_rate(x)		FLAC__stream_decoder_get_sample_rate(x)
-#define FLACdecoder_get_bits_per_sample(x)	FLAC__stream_decoder_get_bits_per_sample(x)
-#define FLACdecoder_get_decode_position(x, y)   FLAC__stream_decoder_get_decode_position(x, y)
+typedef FLAC__SeekableStreamDecoder decoder_t;
+typedef FLAC__SeekableStreamDecoderReadStatus read_status_t;
+
+#define FLACdecoder_new()                       FLAC__seekable_stream_decoder_new()
+#define FLACdecoder_init(x)                     FLAC__seekable_stream_decoder_init(x)
+#define FLACdecoder_process_metadata(x)         FLAC__seekable_stream_decoder_process_until_end_of_metadata(x)
+#define FLACdecoder_process_single(x)           FLAC__seekable_stream_decoder_process_single(x)
+#define FLACdecoder_finish(x)                   FLAC__seekable_stream_decoder_finish(x)
+#define FLACdecoder_delete(x)                   FLAC__seekable_stream_decoder_delete(x)
+#define FLACdecoder_set_read_callback(x, y)     FLAC__seekable_stream_decoder_set_read_callback(x, y)
+#define FLACdecoder_set_write_callback(x, y)    FLAC__seekable_stream_decoder_set_write_callback(x, y)
+#define FLACdecoder_set_metadata_callback(x, y) FLAC__seekable_stream_decoder_set_metadata_callback(x, y)
+#define FLACdecoder_set_error_callback(x, y)    FLAC__seekable_stream_decoder_set_error_callback(x, y)
+#define FLACdecoder_set_client_data(x, y)       FLAC__seekable_stream_decoder_set_client_data(x, y)
+#define FLACdecoder_set_seek_callback(x, y)     FLAC__seekable_stream_decoder_set_seek_callback(x, y)
+#define FLACdecoder_set_tell_callback(x, y)     FLAC__seekable_stream_decoder_set_tell_callback(x, y)
+#define FLACdecoder_set_length_callback(x, y)   FLAC__seekable_stream_decoder_set_length_callback(x, y)
+#define FLACdecoder_set_eof_callback(x, y)      FLAC__seekable_stream_decoder_set_eof_callback(x, y)
+#define FLACdecoder_seek_absolute(x, y)         FLAC__seekable_stream_decoder_seek_absolute(x, y)
+
+#define FLACdecoder_get_state(x)                FLAC__seekable_stream_decoder_get_state(x)
+#define FLACdecoder_get_channels(x)             FLAC__seekable_stream_decoder_get_channels(x)
+#define FLACdecoder_get_blocksize(x)		FLAC__seekable_stream_decoder_get_blocksize(x)
+#define FLACdecoder_get_sample_rate(x)		FLAC__seekable_stream_decoder_get_sample_rate(x)
+#define FLACdecoder_get_bits_per_sample(x)	FLAC__seekable_stream_decoder_get_bits_per_sample(x)
+#define FLACdecoder_get_decode_position(x, y)   FLAC__seekable_stream_decoder_get_decode_position(x, y)
 
 #define SAMPLES_PER_WRITE 512
 
@@ -182,7 +182,7 @@
 	warn("FLAC decoder error_callback: %s\n", status);
 }
 
-static FLAC__StreamDecoderSeekStatus seek_callback(
+static FLAC__SeekableStreamDecoderSeekStatus seek_callback(
 	const decoder_t *decoder,
 	FLAC__uint64 absolute_byte_offset, void *client_data) {
 
@@ -190,17 +190,17 @@
 
 	/* can't seek on a socket */
 	if (datasource->is_streaming) {
-		return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
+		return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR;
 	}
 
 	if (PerlIO_seek(datasource->stream, absolute_byte_offset, SEEK_SET) >= 0) {
-		return FLAC__STREAM_DECODER_SEEK_STATUS_OK;
-	}
-
-	return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
-}
-
-static FLAC__StreamDecoderTellStatus tell_callback(
+		return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK;
+	}
+
+	return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR;
+}
+
+static FLAC__SeekableStreamDecoderTellStatus tell_callback(
 	const decoder_t *decoder,
 	FLAC__uint64 *absolute_byte_offset, void *client_data) {
 
@@ -209,20 +209,20 @@
 	
 	/* can't tell on a socket */
 	if (datasource->is_streaming) {
-		return FLAC__STREAM_DECODER_TELL_STATUS_ERROR;
+		return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR;
 	}
 
 	pos = PerlIO_tell(datasource->stream);
 
 	if (pos < 0) {
-		return FLAC__STREAM_DECODER_TELL_STATUS_ERROR;
+		return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR;
 	}
 
 	*absolute_byte_offset = pos;
-	return FLAC__STREAM_DECODER_TELL_STATUS_OK;
-}
-
-static FLAC__StreamDecoderLengthStatus length_callback(
+	return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK;
+}
+
+static FLAC__SeekableStreamDecoderLengthStatus length_callback(
 	const decoder_t *decoder,
 	FLAC__uint64 *stream_length, void *client_data) {
 
@@ -230,11 +230,11 @@
 
 	/* can't find the total length of a socket */
 	if (datasource->is_streaming) {
-		return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR;
+		return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR;
 	}
 
 	*stream_length = datasource->stream_length;
-	return FLAC__STREAM_DECODER_LENGTH_STATUS_OK;
+	return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK;
 }
 
 static FLAC__bool eof_callback(
@@ -259,7 +259,7 @@
 
 static read_status_t read_callback(
 	const decoder_t *decoder,
-	FLAC__byte buffer[], size_t *bytes, void *client_data) {
+	FLAC__byte buffer[], unsigned *bytes, void *client_data) {
 
 	flac_datasource *datasource = (flac_datasource *)client_data;
 
@@ -267,12 +267,11 @@
 
 	datasource->buffer_size = *bytes;
 
-	if (*bytes == 0)
-		return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
-	if (*bytes < 0)
-		return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
-
-	return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
+	if (*bytes <= 0) {
+		return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR;
+	}
+
+	return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK;
 }
 
 static FLAC__StreamDecoderWriteStatus write_callback(
@@ -370,6 +369,16 @@
 		XSRETURN_UNDEF;
 	}
 
+	FLACdecoder_set_read_callback(datasource->decoder, read_callback);
+	FLACdecoder_set_write_callback(datasource->decoder, write_callback);
+	FLACdecoder_set_metadata_callback(datasource->decoder, meta_callback);
+	FLACdecoder_set_error_callback(datasource->decoder, error_callback);
+	FLACdecoder_set_client_data(datasource->decoder, (void*)datasource);
+	FLACdecoder_set_seek_callback(datasource->decoder, seek_callback);
+	FLACdecoder_set_tell_callback(datasource->decoder, tell_callback);
+	FLACdecoder_set_length_callback(datasource->decoder, length_callback);
+	FLACdecoder_set_eof_callback(datasource->decoder, eof_callback);
+
 	if (!datasource->is_streaming) {
 
 		pos = PerlIO_tell(datasource->stream);
@@ -391,16 +400,7 @@
 		}
 	}
 
-	if (FLACdecoder_init(datasource->decoder,
-	                     read_callback,
-	                     seek_callback,
-	                     tell_callback,
-	                     length_callback,
-	                     eof_callback,
-	                     write_callback,
-	                     meta_callback,
-	                     error_callback,
-	                     datasource) != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
+	if (FLACdecoder_init(datasource->decoder) != FLAC__SEEKABLE_STREAM_DECODER_OK) {
 
 		warn("Failed on initializing the decoder: [%d]\n", FLACdecoder_get_state(datasource->decoder));
 
@@ -459,7 +459,7 @@
 
 		unsigned s = datasource->wide_samples_in_reservoir;
 
-		if (FLACdecoder_get_state(datasource->decoder) == FLAC__STREAM_DECODER_END_OF_STREAM ) {
+		if (FLACdecoder_get_state(datasource->decoder) == FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM ) {
 			break;
 
 		} else if (!FLACdecoder_process_single(datasource->decoder)) {
@@ -595,7 +595,7 @@
 		XSRETURN_UNDEF;
 	}
 
-	if (!FLAC__stream_decoder_reset(datasource->decoder)) {
+	if (!FLAC__seekable_stream_decoder_reset(datasource->decoder)) {
 		XSRETURN_UNDEF;
 	}
 

Modified: branches/upstream/libaudio-flac-decoder-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libaudio-flac-decoder-perl/current/MANIFEST?rev=41549&op=diff
==============================================================================
--- branches/upstream/libaudio-flac-decoder-perl/current/MANIFEST (original)
+++ branches/upstream/libaudio-flac-decoder-perl/current/MANIFEST Sat Aug  8 21:17:27 2009
@@ -5,9 +5,8 @@
 MANIFEST
 README
 TODO
-t/decoder.t
-t/pod.t
-t/test.flac
+test.pl
+test.flac
 examples/decode
 include/common.h
 include/dither.h

Modified: branches/upstream/libaudio-flac-decoder-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libaudio-flac-decoder-perl/current/META.yml?rev=41549&op=diff
==============================================================================
--- branches/upstream/libaudio-flac-decoder-perl/current/META.yml (original)
+++ branches/upstream/libaudio-flac-decoder-perl/current/META.yml Sat Aug  8 21:17:27 2009
@@ -1,10 +1,10 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Audio-FLAC-Decoder
-version:      0.3
+version:      0.2
 version_from: Decoder.pm
 installdirs:  site
 requires:
 
 distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30_01
+generated_by: ExtUtils::MakeMaker version 6.21

Modified: branches/upstream/libaudio-flac-decoder-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libaudio-flac-decoder-perl/current/README?rev=41549&op=diff
==============================================================================
--- branches/upstream/libaudio-flac-decoder-perl/current/README (original)
+++ branches/upstream/libaudio-flac-decoder-perl/current/README Sat Aug  8 21:17:27 2009
@@ -21,7 +21,7 @@
 
 COPYRIGHT AND LICENCE
 
-Copyright (c) 2004-2008, Dan Sully.  All Rights Reserved.
+Copyright (c) 2004, Dan Sully.  All Rights Reserved.
 
 This program is free software; you can redistribute it and/or modify it
 under the terms of the GNU General Public License as published by the




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