Group :: Som
RPM: audacity
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Patch: audacity-1.3.2+flac-1.1.3.patch
Download
Download
diff -urN audacity-src-1.3.2-beta.orig/acinclude.m4 audacity-src-1.3.2-beta/acinclude.m4
--- audacity-src-1.3.2-beta.orig/acinclude.m4 2006-10-29 02:06:04 +0300
+++ audacity-src-1.3.2-beta/acinclude.m4 2007-02-19 15:22:18 +0200
@@ -467,7 +467,7 @@
dnl See if FLAC is installed in the system
AC_CHECK_LIB(FLAC,
- FLAC__file_decoder_new,
+ FLAC__stream_decoder_new,
lib_found="yes",
lib_found="no",
-lFLAC++ -lFLAC)
diff -urN audacity-src-1.3.2-beta.orig/src/export/ExportFLAC.cpp audacity-src-1.3.2-beta/src/export/ExportFLAC.cpp
--- audacity-src-1.3.2-beta.orig/src/export/ExportFLAC.cpp 2006-10-29 02:05:27 +0300
+++ audacity-src-1.3.2-beta/src/export/ExportFLAC.cpp 2007-02-19 15:27:14 +0200
@@ -32,6 +32,12 @@
#include <vorbis/vorbisenc.h>
#include "FLAC++/encoder.h"
+#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8
+#define LEGACY_FLAC
+#else
+#undef LEGACY_FLAC
+#endif
+
#include "../Project.h"
#include "../Mix.h"
#include "../Prefs.h"
@@ -58,9 +64,14 @@
gPrefs->Read(wxT("/FileFormats/FLACBitDepth"), wxT("16"));
FLAC::Encoder::File *encoder= new FLAC::Encoder::File();
+#ifdef LEGACY_FLAC
encoder->set_filename(OSFILENAME(fName));
encoder->set_channels(numChannels);
encoder->set_sample_rate(int(rate + 0.5));
+#else
+ encoder->set_channels(numChannels);
+ encoder->set_sample_rate(int(rate + 0.5));
+#endif
tags->ExportFLACTags(encoder);
@@ -72,7 +83,11 @@
format=int16Sample;
encoder->set_bits_per_sample(16);
}
+#ifdef LEGACY_FLAC
encoder->init();
+#else
+ encoder->init(OSFILENAME(fName));
+#endif
int numWaveTracks;
WaveTrack **waveTracks;
@@ -129,7 +144,7 @@
return !cancelling;
}
-#endif // USE_LIBVORBIS
+#endif // USE_LIBFLAC
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
diff -urN audacity-src-1.3.2-beta.orig/src/import/ImportFLAC.cpp audacity-src-1.3.2-beta/src/import/ImportFLAC.cpp
--- audacity-src-1.3.2-beta.orig/src/import/ImportFLAC.cpp 2006-10-29 02:05:28 +0300
+++ audacity-src-1.3.2-beta/src/import/ImportFLAC.cpp 2007-02-19 15:27:02 +0200
@@ -58,6 +58,13 @@
#include "FLAC++/decoder.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
+
#include "../FileFormats.h"
#include "../Prefs.h"
#include "../WaveTrack.h"
@@ -264,19 +271,22 @@
bool FLACImportFileHandle::Init()
{
- bool success = mFile->set_filename(OSFILENAME(mName));
- if (!success) {
- return false;
- }
- FLAC::Decoder::File::State state = mFile->init();
- if (state != FLAC__FILE_DECODER_OK) {
+#ifdef LEGACY_FLAC
+ if (!mFile->set_filename(OSFILENAME(mName))) return false;
+#endif
+#ifdef LEGACY_FLAC
+ if (mFile->init() != FLAC__FILE_DECODER_OK)
+#else
+ if (mFile->init(OSFILENAME(mName)) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
+#endif
return false;
- }
mFile->process_until_end_of_metadata();
- state = mFile->get_state();
- if (state != FLAC__FILE_DECODER_OK) {
+#ifdef LEGACY_FLAC
+ if (mFile->get_state() != FLAC__FILE_DECODER_OK)
+#else
+ if (!mFile->get_state())
+#endif
return false;
- }
if (!mFile->is_valid() || mFile->get_was_error())
{
// This probably is not a FLAC file at all
@@ -340,7 +350,11 @@
mChannels[1]->SetTeamed(true);
}
+#ifdef LEGACY_FLAC
mFile->process_until_end_of_file();
+#else
+ mFile->process_until_end_of_stream();
+#endif
*outTracks = new Track *[*outNumTracks];
for(c = 0; c < *outNumTracks; c++) {