Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 103732 Details for
Bug 157706
app-cdr/cuecue-0.2.2 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
cuecue-0.2.2+flac-1.1.3.patch (text/plain), 3.59 KB, created by
Alexis Ballier
on 2006-12-10 02:40:33 UTC
(
hide
)
Description:
Patch from Josh Coalson
Filename:
MIME Type:
Creator:
Alexis Ballier
Created:
2006-12-10 02:40:33 UTC
Size:
3.59 KB
patch
obsolete
>diff -r -u cuecue-0.2.2/src/libcuecue/flac.c cuecue-0.2.2-b2/src/libcuecue/flac.c >--- cuecue-0.2.2/src/libcuecue/flac.c 2004-09-21 19:28:21.000000000 -0700 >+++ cuecue-0.2.2-b2/src/libcuecue/flac.c 2006-10-24 22:54:01.000000000 -0700 >@@ -27,6 +27,12 @@ > #include "cuecue.h" > #include "cuecue_internal.h" > >+#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8 >+#define LEGACY_FLAC >+#else >+#undef LEGACY_FLAC >+#endif >+ > typedef struct Internal > { > FILE *dst; >@@ -38,7 +44,11 @@ > } Internal; > > >+#ifdef LEGACY_FLAC > void error(const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) >+#else >+void error(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) >+#endif > { > Internal *internal = client_data; > switch (status) { >@@ -52,11 +62,19 @@ > strcpy(cuecue_error,"CRC Mismatch: FLAC file corrupted"); > internal->error=1; > break; >+ case FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM: >+ strcpy(cuecue_error,"Unparseable stream"); >+ internal->error=1; >+ break; > } > } > > >+#ifdef LEGACY_FLAC > void metadata(const FLAC__FileDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) >+#else >+void metadata(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) >+#endif > { > if(metadata->type == FLAC__METADATA_TYPE_STREAMINFO) { > /* get size of the file, for progress callback */ >@@ -66,7 +84,11 @@ > } > > >+#ifdef LEGACY_FLAC > FLAC__StreamDecoderWriteStatus write(const FLAC__FileDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data) >+#else >+FLAC__StreamDecoderWriteStatus write(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data) >+#endif > { > Internal *internal = client_data; > unsigned int samples = frame->header.blocksize; >@@ -126,7 +148,11 @@ > { > FILE *dst; > Internal internal; >+#ifdef LEGACY_FLAC > FLAC__FileDecoder *decoder; >+#else >+ FLAC__StreamDecoder *decoder; >+#endif > > dst = fopen(file_destination, "wb"); > >@@ -141,7 +167,11 @@ > internal.error=0; > internal.dst=dst; > >+#ifdef LEGACY_FLAC > decoder = FLAC__file_decoder_new(); >+#else >+ decoder = FLAC__stream_decoder_new(); >+#endif > > if (decoder==NULL) { > snprintf(cuecue_error,CUECUE_ERROR_LENGTH,"Cannot create FLAC decoder! memory error ?"); >@@ -150,6 +180,7 @@ > > internal.buffer = malloc(BUFFER_SIZE); > >+#ifdef LEGACY_FLAC > FLAC__file_decoder_set_md5_checking(decoder, true); > FLAC__file_decoder_set_filename(decoder, file_source); > >@@ -162,8 +193,20 @@ > snprintf(cuecue_error,1024,"Cannot open '%s'",file_source); > internal.error=1; > } >+#else >+ FLAC__stream_decoder_set_md5_checking(decoder, true); >+ if(FLAC__stream_decoder_init_file(decoder, file_source, write, metadata, error, &internal) != FLAC__STREAM_DECODER_INIT_STATUS_OK) { >+ snprintf(cuecue_error,1024,"Cannot open '%s'",file_source); >+ internal.error=1; >+ } >+#endif > >- if(!FLAC__file_decoder_process_until_end_of_file(decoder)) { >+#ifdef LEGACY_FLAC >+ if(!FLAC__file_decoder_process_until_end_of_file(decoder)) >+#else >+ if(!FLAC__stream_decoder_process_until_end_of_stream(decoder)) >+#endif >+ { > if (!internal.error) { > /* early error, not even the time to decode metadata :) */ > snprintf(cuecue_error,CUECUE_ERROR_LENGTH,"Cannot open '%s'",file_source); >@@ -171,8 +214,13 @@ > internal.error=1; > } > >+#ifdef LEGACY_FLAC > FLAC__file_decoder_finish(decoder); > FLAC__file_decoder_delete(decoder); >+#else >+ FLAC__stream_decoder_finish(decoder); >+ FLAC__stream_decoder_delete(decoder); >+#endif > > fclose(dst); > free(internal.buffer);
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 157706
: 103732