forked from pool/audacity
123 lines
3.9 KiB
Diff
123 lines
3.9 KiB
Diff
--- acinclude.m4
|
|
+++ acinclude.m4
|
|
@@ -479,7 +479,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)
|
|
--- configure
|
|
+++ configure
|
|
@@ -4316,9 +4316,9 @@
|
|
fi;
|
|
|
|
|
|
- echo "$as_me:$LINENO: checking for FLAC__file_decoder_new in -lFLAC" >&5
|
|
-echo $ECHO_N "checking for FLAC__file_decoder_new in -lFLAC... $ECHO_C" >&6
|
|
-if test "${ac_cv_lib_FLAC_FLAC__file_decoder_new+set}" = set; then
|
|
+ { echo "$as_me:$LINENO: checking for FLAC__stream_decoder_init_file in -lFLAC" >&5
|
|
+echo $ECHO_N "checking for FLAC__stream_decoder_init_file in -lFLAC... $ECHO_C" >&6; }
|
|
+if test "${ac_cv_lib_FLAC_FLAC__stream_decoder_init_file+set}" = set; then
|
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
|
else
|
|
ac_check_lib_save_LIBS=$LIBS
|
|
@@ -4336,11 +4336,11 @@
|
|
#endif
|
|
/* We use char because int might match the return type of a gcc2
|
|
builtin and then its argument prototype would still apply. */
|
|
-char FLAC__file_decoder_new ();
|
|
+char FLAC__stream_decoder_init_file ();
|
|
int
|
|
main ()
|
|
{
|
|
-FLAC__file_decoder_new ();
|
|
+FLAC__stream_decoder_init_file ();
|
|
;
|
|
return 0;
|
|
}
|
|
@@ -4367,20 +4367,20 @@
|
|
ac_status=$?
|
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
|
(exit $ac_status); }; }; then
|
|
- ac_cv_lib_FLAC_FLAC__file_decoder_new=yes
|
|
+ ac_cv_lib_FLAC_FLAC__stream_decoder_init_file=yes
|
|
else
|
|
echo "$as_me: failed program was:" >&5
|
|
sed 's/^/| /' conftest.$ac_ext >&5
|
|
|
|
-ac_cv_lib_FLAC_FLAC__file_decoder_new=no
|
|
+ac_cv_lib_FLAC_FLAC__stream_decoder_init_file=no
|
|
fi
|
|
rm -f conftest.err conftest.$ac_objext \
|
|
conftest$ac_exeext conftest.$ac_ext
|
|
LIBS=$ac_check_lib_save_LIBS
|
|
fi
|
|
-echo "$as_me:$LINENO: result: $ac_cv_lib_FLAC_FLAC__file_decoder_new" >&5
|
|
-echo "${ECHO_T}$ac_cv_lib_FLAC_FLAC__file_decoder_new" >&6
|
|
-if test $ac_cv_lib_FLAC_FLAC__file_decoder_new = yes; then
|
|
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_FLAC_FLAC__stream_decoder_init_file" >&5
|
|
+echo "${ECHO_T}$ac_cv_lib_FLAC_FLAC__stream_decoder_init_file" >&6; }
|
|
+if test $ac_cv_lib_FLAC_FLAC__stream_decoder_init_file = yes; then
|
|
lib_found="yes"
|
|
else
|
|
lib_found="no"
|
|
--- src/import/ImportFLAC.cpp
|
|
+++ src/import/ImportFLAC.cpp
|
|
@@ -264,19 +264,15 @@
|
|
|
|
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) {
|
|
+ FLAC__StreamDecoderInitStatus state = mFile->init(OSFILENAME(mName));
|
|
+ if (state != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
|
|
return false;
|
|
}
|
|
mFile->process_until_end_of_metadata();
|
|
- state = mFile->get_state();
|
|
- if (state != FLAC__FILE_DECODER_OK) {
|
|
- return false;
|
|
- }
|
|
+ // FLAC__StreamDecoderState decstate = mFile->get_state();
|
|
+ // if (state != FLAC__STREAM_DECODER_FILE_DECODER_OK) {
|
|
+ // return false;
|
|
+ // }
|
|
if (!mFile->is_valid() || mFile->get_was_error())
|
|
{
|
|
// This probably is not a FLAC file at all
|
|
@@ -340,7 +336,7 @@
|
|
mChannels[1]->SetTeamed(true);
|
|
}
|
|
|
|
- mFile->process_until_end_of_file();
|
|
+ mFile->process_until_end_of_stream();
|
|
|
|
*outTracks = new Track *[*outNumTracks];
|
|
for(c = 0; c < *outNumTracks; c++) {
|
|
--- src/export/ExportFLAC.cpp
|
|
+++ src/export/ExportFLAC.cpp
|
|
@@ -229,7 +229,6 @@
|
|
gPrefs->Read(wxT("/FileFormats/FLACBitDepth"), wxT("16"));
|
|
|
|
FLAC::Encoder::File *encoder= new FLAC::Encoder::File();
|
|
- encoder->set_filename(OSFILENAME(fName));
|
|
encoder->set_channels(numChannels);
|
|
encoder->set_sample_rate(int(rate + 0.5));
|
|
|
|
@@ -264,7 +263,7 @@
|
|
encoder->set_rice_parameter_search_dist(flacLevels[levelPref].rice_parameter_search_dist);
|
|
encoder->set_max_lpc_order(flacLevels[levelPref].max_lpc_order);
|
|
|
|
- encoder->init();
|
|
+ encoder->init(OSFILENAME(fName));
|
|
|
|
int numWaveTracks;
|
|
WaveTrack **waveTracks;
|