Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 103669 Details for
Bug 157587
gnustep-apps/cynthiune : bump to 0.9.5 and flac 1.1.3 compatibility patch
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch from Josh Coalson
Cynthiune-0.9.5+flac-1.1.3.patch (text/plain), 8.71 KB, created by
Alexis Ballier
on 2006-12-09 02:28:10 UTC
(
hide
)
Description:
Patch from Josh Coalson
Filename:
MIME Type:
Creator:
Alexis Ballier
Created:
2006-12-09 02:28:10 UTC
Size:
8.71 KB
patch
obsolete
>diff -ru Cynthiune-0.9.5/Bundles/FLAC/FLAC.h Cynthiune-0.9.5-b2/Bundles/FLAC/FLAC.h >--- Cynthiune-0.9.5/Bundles/FLAC/FLAC.h 2006-03-21 02:11:19.000000000 -0800 >+++ Cynthiune-0.9.5-b2/Bundles/FLAC/FLAC.h 2006-10-26 08:09:13.000000000 -0700 >@@ -31,7 +31,11 @@ > > @interface FLAC : NSObject <CynthiuneBundle, Format> > { >+#ifdef LEGACY_FLAC > FLAC__FileDecoder *fileDecoder; >+#else >+ FLAC__StreamDecoder *fileDecoder; >+#endif > > unsigned int bitsPerSample; > unsigned int duration; >diff -ru Cynthiune-0.9.5/Bundles/FLAC/FLAC.m Cynthiune-0.9.5-b2/Bundles/FLAC/FLAC.m >--- Cynthiune-0.9.5/Bundles/FLAC/FLAC.m 2006-03-21 13:39:13.000000000 -0800 >+++ Cynthiune-0.9.5-b2/Bundles/FLAC/FLAC.m 2006-10-26 08:22:14.000000000 -0700 >@@ -34,13 +34,25 @@ > #import <Cynthiune/Format.h> > #import <Cynthiune/utils.h> > >+/* FLAC 1.1.3 has FLAC_API_VERSION_CURRENT == 8 */ >+#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8 >+#define LEGACY_FLAC >+#else >+#undef LEGACY_FLAC >+#endif >+ > #import "FLAC.h" > > #define LOCALIZED(X) _b ([FLAC class], X) > > static FLAC__StreamDecoderWriteStatus >+#ifdef LEGACY_FLAC > writeCallback (const FLAC__FileDecoder *fileDecoder, const FLAC__Frame *frame, > const FLAC__int32 * const buffer[], void *clientData) >+#else >+writeCallback (const FLAC__StreamDecoder *fileDecoder, const FLAC__Frame *frame, >+ const FLAC__int32 * const buffer[], void *clientData) >+#endif > { > CFLAC *cStream; > unsigned int sample, channel; >@@ -70,9 +82,15 @@ > } > > static void >+#ifdef LEGACY_FLAC > metadataCallback (const FLAC__FileDecoder *fileDecoder, > const FLAC__StreamMetadata *metadata, > void *clientData) >+#else >+metadataCallback (const FLAC__StreamDecoder *fileDecoder, >+ const FLAC__StreamMetadata *metadata, >+ void *clientData) >+#endif > { > CFLAC *cStream; > >@@ -88,9 +106,15 @@ > } > > static void >+#ifdef LEGACY_FLAC > errorCallback (const FLAC__FileDecoder *fileDecoder, > FLAC__StreamDecoderErrorStatus status, > void *clientData) >+#else >+errorCallback (const FLAC__StreamDecoder *fileDecoder, >+ FLAC__StreamDecoderErrorStatus status, >+ void *clientData) >+#endif > { > NSLog (@"FLAC: received error with status %d", status); > } >@@ -161,6 +185,7 @@ > > - (BOOL) _initializeFileDecoderWithFilename: (NSString *) fileName > { >+#ifdef LEGACY_FLAC > FLAC__file_decoder_set_metadata_ignore_all (fileDecoder); > FLAC__file_decoder_set_metadata_respond (fileDecoder, > FLAC__METADATA_TYPE_STREAMINFO); >@@ -173,13 +198,25 @@ > return (FLAC__file_decoder_set_filename (fileDecoder, [fileName cString]) > && (FLAC__file_decoder_init (fileDecoder) == FLAC__FILE_DECODER_OK) > && FLAC__file_decoder_process_until_end_of_metadata (fileDecoder)); >+#else >+ FLAC__stream_decoder_set_metadata_ignore_all (fileDecoder); >+ FLAC__stream_decoder_set_metadata_respond (fileDecoder, >+ FLAC__METADATA_TYPE_STREAMINFO); >+ return ((FLAC__stream_decoder_init_file (fileDecoder, [fileName cString], >+ writeCallback, metadataCallback, errorCallback, self) == FLAC__STREAM_DECODER_INIT_STATUS_OK) >+ && FLAC__stream_decoder_process_until_end_of_metadata (fileDecoder)); >+#endif > } > > - (BOOL) streamOpen: (NSString *) fileName > { > BOOL result; > >+#ifdef LEGACY_FLAC > fileDecoder = FLAC__file_decoder_new(); >+#else >+ fileDecoder = FLAC__stream_decoder_new(); >+#endif > > if (fileDecoder) > { >@@ -187,7 +224,11 @@ > result = YES; > else > { >+#ifdef LEGACY_FLAC > FLAC__file_decoder_delete (fileDecoder); >+#else >+ FLAC__stream_decoder_delete (fileDecoder); >+#endif > fileDecoder = NULL; > result = NO; > } >@@ -200,7 +241,11 @@ > > - (void) streamClose > { >+#ifdef LEGACY_FLAC > FLAC__file_decoder_delete (fileDecoder); >+#else >+ FLAC__stream_decoder_delete (fileDecoder); >+#endif > fileDecoder = NULL; > } > >@@ -215,7 +260,11 @@ > if (position >= readBufferSize) > { > position = 0; >+#ifdef LEGACY_FLAC > success = FLAC__file_decoder_process_single (fileDecoder); >+#else >+ success = FLAC__stream_decoder_process_single (fileDecoder); >+#endif > } > > if (success) >@@ -251,13 +300,27 @@ > withSize: (unsigned int) bufferSize > { > int readBytes; >+#ifdef LEGACY_FLAC > FLAC__FileDecoderState state; > > state = FLAC__file_decoder_get_state (fileDecoder); >+#else >+ FLAC__StreamDecoderState state; >+ >+ state = FLAC__stream_decoder_get_state (fileDecoder); >+#endif > >+#ifdef LEGACY_FLAC > if (state == FLAC__FILE_DECODER_OK) >+#else >+ if (state < FLAC__STREAM_DECODER_END_OF_STREAM) >+#endif > readBytes = [self _processNextChunk: buffer withSize: bufferSize]; >+#ifdef LEGACY_FLAC > else if (state == FLAC__FILE_DECODER_END_OF_FILE) >+#else >+ else if (state == FLAC__STREAM_DECODER_END_OF_STREAM) >+#endif > readBytes = 0; > else > readBytes = -1; >@@ -272,7 +335,11 @@ > > - (void) seek: (unsigned int) aPos > { >+#ifdef LEGACY_FLAC > FLAC__file_decoder_seek_absolute (fileDecoder, aPos * rate); >+#else >+ FLAC__stream_decoder_seek_absolute (fileDecoder, aPos * rate); >+#endif > } > > - (unsigned int) readChannels >@@ -295,7 +362,11 @@ > if (readBuffer) > free (readBuffer); > if (fileDecoder) >+#ifdef LEGACY_FLAC > FLAC__file_decoder_delete (fileDecoder); >+#else >+ FLAC__stream_decoder_delete (fileDecoder); >+#endif > [super dealloc]; > } > >diff -ru Cynthiune-0.9.5/Bundles/FLACTags/FLACTags.m Cynthiune-0.9.5-b2/Bundles/FLACTags/FLACTags.m >--- Cynthiune-0.9.5/Bundles/FLACTags/FLACTags.m 2006-03-21 13:41:04.000000000 -0800 >+++ Cynthiune-0.9.5-b2/Bundles/FLACTags/FLACTags.m 2006-10-26 08:25:06.000000000 -0700 >@@ -33,6 +33,13 @@ > > #import "FLACTags.h" > >+/* FLAC 1.1.3 has FLAC_API_VERSION_CURRENT == 8 */ >+#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8 >+#define LEGACY_FLAC >+#else >+#undef LEGACY_FLAC >+#endif >+ > #define LOCALIZED(X) _b ([FLACTags class], X) > > static inline int >@@ -78,16 +85,27 @@ > } > > static FLAC__StreamDecoderWriteStatus >+#ifdef LEGACY_FLAC > writeCallback (const FLAC__FileDecoder *fileDecoder, const FLAC__Frame *frame, > const FLAC__int32 * const buffer[], void *clientData) >+#else >+writeCallback (const FLAC__StreamDecoder *fileDecoder, const FLAC__Frame *frame, >+ const FLAC__int32 * const buffer[], void *clientData) >+#endif > { > return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; > } > > static void >+#ifdef LEGACY_FLAC > metadataCallback (const FLAC__FileDecoder *fileDecoder, > const FLAC__StreamMetadata *metadata, > void *clientData) >+#else >+metadataCallback (const FLAC__StreamDecoder *fileDecoder, >+ const FLAC__StreamMetadata *metadata, >+ void *clientData) >+#endif > { > unsigned int count; > >@@ -104,9 +122,15 @@ > } > > static void >+#ifdef LEGACY_FLAC > errorCallback (const FLAC__FileDecoder *fileDecoder, > FLAC__StreamDecoderErrorStatus status, > void *clientData) >+#else >+errorCallback (const FLAC__StreamDecoder *fileDecoder, >+ FLAC__StreamDecoderErrorStatus status, >+ void *clientData) >+#endif > { > NSLog (@"FLACTags: received error with status %d", status); > } >@@ -132,14 +156,23 @@ > year: (NSString **) year > ofFilename: (NSString *) filename > { >+#ifdef LEGACY_FLAC > FLAC__FileDecoder *fileDecoder; >+#else >+ FLAC__StreamDecoder *fileDecoder; >+#endif > BOOL result; > NSString **arrayOfValues[] = { title, artist, album, trackNumber, > genre, year }; > >+#ifdef LEGACY_FLAC > fileDecoder = FLAC__file_decoder_new(); >+#else >+ fileDecoder = FLAC__stream_decoder_new(); >+#endif > if (fileDecoder) > { >+#ifdef LEGACY_FLAC > FLAC__file_decoder_set_metadata_ignore_all (fileDecoder); > FLAC__file_decoder_set_metadata_respond (fileDecoder, > FLAC__METADATA_TYPE_VORBIS_COMMENT); >@@ -156,6 +189,17 @@ > && FLAC__file_decoder_process_until_end_of_metadata > (fileDecoder)); > FLAC__file_decoder_delete (fileDecoder); >+#else >+ FLAC__stream_decoder_set_metadata_ignore_all (fileDecoder); >+ FLAC__stream_decoder_set_metadata_respond (fileDecoder, >+ FLAC__METADATA_TYPE_VORBIS_COMMENT); >+ result = ((FLAC__stream_decoder_init_file (fileDecoder, [filename cString], >+ writeCallback, metadataCallback, errorCallback, arrayOfValues) >+ == FLAC__STREAM_DECODER_INIT_STATUS_OK) >+ && FLAC__stream_decoder_process_until_end_of_metadata >+ (fileDecoder)); >+ FLAC__stream_decoder_delete (fileDecoder); >+#endif > } > else > result = NO;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 157587
: 103669