ALT Linux Bugzilla
– Attachment 1812 Details for
Bug 10868
unsupported flac >= 1.1.3
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
audacity-1.3.2+flac-1.1.3.patch
audacity-1.3.2+flac-1.1.3.patch (text/plain), 3.63 KB, created by
led
on 2007-02-19 18:11:58 MSK
(
hide
)
Description:
audacity-1.3.2+flac-1.1.3.patch
Filename:
MIME Type:
Creator:
led
Created:
2007-02-19 18:11:58 MSK
Size:
3.63 KB
patch
obsolete
>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++) {
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 10868
: 1812