Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 103809 Details for
Bug 157125
media-sound/easytag-1.99.12 patch for new FLAC API
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch_19912_use_flac_1.1.3.diff
patch_19912_use_flac_1.1.3.diff (text/plain), 4.79 KB, created by
Maarten Maathuis
on 2006-12-11 08:30:50 UTC
(
hide
)
Description:
patch_19912_use_flac_1.1.3.diff
Filename:
MIME Type:
Creator:
Maarten Maathuis
Created:
2006-12-11 08:30:50 UTC
Size:
4.79 KB
patch
obsolete
>diff -ru easytag-1.99.12/src/flac_header.c easytag-1.99.12-b2/src/flac_header.c >--- easytag-1.99.12/src/flac_header.c 2005-10-22 12:34:56.000000000 -0700 >+++ easytag-1.99.12-b2/src/flac_header.c 2006-10-30 23:54:34.000000000 -0800 >@@ -41,6 +41,13 @@ > #include "misc.h" > #include "charset.h" > >+/* FLAC 1.1.3 has FLAC_API_VERSION_CURRENT == 8 */ >+/* by LEGACY_FLAC we mean pre-FLAC 1.1.3; in FLAC 1.1.3 the FLAC__FileDecoder was merged into the FLAC__StreamDecoder */ >+#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8 >+#define LEGACY_FLAC >+#else >+#undef LEGACY_FLAC >+#endif > > > /**************** >@@ -75,9 +82,15 @@ > /************** > * Prototypes * > **************/ >+#ifdef LEGACY_FLAC > static FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__FileDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data); > static void metadata_callback_(const FLAC__FileDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data); > static void error_callback_ (const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data); >+#else >+static FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data); >+static void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data); >+static void error_callback_ (const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data); >+#endif > > > >@@ -95,7 +108,11 @@ > gdouble duration = 0; > gulong filesize; > >+#ifdef LEGACY_FLAC > FLAC__FileDecoder *tmp_decoder; >+#else >+ FLAC__StreamDecoder *tmp_decoder; >+#endif > file_info_struct tmp_file_info; > > if (!filename || !ETFileInfo) >@@ -111,13 +128,18 @@ > fclose(file); > > /* Decoding FLAC file */ >+#ifdef LEGACY_FLAC > tmp_decoder = FLAC__file_decoder_new(); >+#else >+ tmp_decoder = FLAC__stream_decoder_new(); >+#endif > if (tmp_decoder == 0) > { > return FALSE; > } > > tmp_file_info.abort_flag = false; >+#ifdef LEGACY_FLAC > FLAC__file_decoder_set_md5_checking (tmp_decoder, false); > FLAC__file_decoder_set_filename (tmp_decoder, filename); > FLAC__file_decoder_set_write_callback (tmp_decoder, write_callback_); >@@ -129,6 +151,13 @@ > return FALSE; > } > >+#else >+ FLAC__stream_decoder_set_md5_checking (tmp_decoder, false); >+ if(FLAC__stream_decoder_init_file(tmp_decoder, filename, write_callback_, metadata_callback_, error_callback_, &tmp_file_info) != FLAC__STREAM_DECODER_INIT_STATUS_OK) >+ return FALSE; >+#endif >+ >+#ifdef LEGACY_FLAC > // In FLAC 1.0.3, is used : FLAC__file_decoder_process_metadata > // In FLAC 1.0.4, is used : FLAC__file_decoder_process_until_end_of_metadata > #if ( (LIBFLAC_MAJOR <= 1) && (LIBFLAC_MINOR <= 0) && (LIBFLAC_PATCH <= 3) ) >@@ -136,12 +165,20 @@ > #else > if (!FLAC__file_decoder_process_until_end_of_metadata(tmp_decoder)) // FLAC 1.0.4 (Bastian Kleineidam) > #endif >+#else >+ if(!FLAC__stream_decoder_process_until_end_of_metadata(tmp_decoder)) >+#endif > { > return FALSE; > } > >+#ifdef LEGACY_FLAC > FLAC__file_decoder_finish(tmp_decoder); > FLAC__file_decoder_delete(tmp_decoder); >+#else >+ FLAC__stream_decoder_finish(tmp_decoder); >+ FLAC__stream_decoder_delete(tmp_decoder); >+#endif > /* End of decoding FLAC file */ > > >@@ -161,7 +198,11 @@ > > > >+#ifdef LEGACY_FLAC > FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__FileDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data) >+#else >+FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data) >+#endif > { > file_info_struct *file_info = (file_info_struct *)client_data; > const unsigned bps = file_info->bits_per_sample, channels = file_info->channels, wide_samples = frame->header.blocksize; >@@ -194,7 +235,11 @@ > return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; > } > >+#ifdef LEGACY_FLAC > void metadata_callback_(const FLAC__FileDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) >+#else >+void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) >+#endif > { > file_info_struct *file_info = (file_info_struct *)client_data; > (void)decoder; >@@ -219,7 +264,11 @@ > } > } > >+#ifdef LEGACY_FLAC > void error_callback_(const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) >+#else >+void error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) >+#endif > { > file_info_struct *file_info = (file_info_struct *)client_data; > (void)decoder;
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 157125
:
103345
| 103809