View | Details | Raw Unified | Return to bug 10868
Collapse All | Expand All

(-)audacity-src-1.3.2-beta.orig/acinclude.m4 (-1 / +1 lines)
Lines 467-473 Link Here
467
   dnl See if FLAC is installed in the system
467
   dnl See if FLAC is installed in the system
468
468
469
   AC_CHECK_LIB(FLAC,
469
   AC_CHECK_LIB(FLAC,
470
                FLAC__file_decoder_new,
470
                FLAC__stream_decoder_new,
471
                lib_found="yes",
471
                lib_found="yes",
472
                lib_found="no",
472
                lib_found="no",
473
                -lFLAC++ -lFLAC)
473
                -lFLAC++ -lFLAC)
(-)audacity-src-1.3.2-beta.orig/src/export/ExportFLAC.cpp (-1 / +16 lines)
Lines 32-37 Link Here
32
#include <vorbis/vorbisenc.h>
32
#include <vorbis/vorbisenc.h>
33
#include "FLAC++/encoder.h"
33
#include "FLAC++/encoder.h"
34
34
35
#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8
36
#define LEGACY_FLAC
37
#else
38
#undef LEGACY_FLAC
39
#endif
40
35
#include "../Project.h"
41
#include "../Project.h"
36
#include "../Mix.h"
42
#include "../Mix.h"
37
#include "../Prefs.h"
43
#include "../Prefs.h"
Lines 58-66 Link Here
58
      gPrefs->Read(wxT("/FileFormats/FLACBitDepth"), wxT("16"));
64
      gPrefs->Read(wxT("/FileFormats/FLACBitDepth"), wxT("16"));
59
   
65
   
60
   FLAC::Encoder::File *encoder= new FLAC::Encoder::File();
66
   FLAC::Encoder::File *encoder= new FLAC::Encoder::File();
67
#ifdef LEGACY_FLAC
61
   encoder->set_filename(OSFILENAME(fName));
68
   encoder->set_filename(OSFILENAME(fName));
62
   encoder->set_channels(numChannels);
69
   encoder->set_channels(numChannels);
63
   encoder->set_sample_rate(int(rate + 0.5));
70
   encoder->set_sample_rate(int(rate + 0.5));
71
#else
72
   encoder->set_channels(numChannels);
73
   encoder->set_sample_rate(int(rate + 0.5));
74
#endif
64
75
65
   tags->ExportFLACTags(encoder);
76
   tags->ExportFLACTags(encoder);
66
   
77
   
Lines 72-78 Link Here
72
    	format=int16Sample;
83
    	format=int16Sample;
73
   	encoder->set_bits_per_sample(16);
84
   	encoder->set_bits_per_sample(16);
74
   }
85
   }
86
#ifdef LEGACY_FLAC
75
   encoder->init();
87
   encoder->init();
88
#else
89
   encoder->init(OSFILENAME(fName));
90
#endif
76
   
91
   
77
   int numWaveTracks;
92
   int numWaveTracks;
78
   WaveTrack **waveTracks;
93
   WaveTrack **waveTracks;
Lines 129-135 Link Here
129
   return !cancelling;
144
   return !cancelling;
130
}
145
}
131
146
132
#endif // USE_LIBVORBIS
147
#endif // USE_LIBFLAC
133
148
134
149
135
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
150
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
(-)audacity-src-1.3.2-beta.orig/src/import/ImportFLAC.cpp (-10 / +24 lines)
Lines 58-63 Link Here
58
58
59
#include "FLAC++/decoder.h"
59
#include "FLAC++/decoder.h"
60
60
61
/* FLAC 1.1.3 has FLAC_API_VERSION_CURRENT == 8 */
62
#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8
63
#define LEGACY_FLAC
64
#else
65
#undef LEGACY_FLAC
66
#endif
67
61
#include "../FileFormats.h"
68
#include "../FileFormats.h"
62
#include "../Prefs.h"
69
#include "../Prefs.h"
63
#include "../WaveTrack.h"
70
#include "../WaveTrack.h"
Lines 264-282 Link Here
264
271
265
bool FLACImportFileHandle::Init()
272
bool FLACImportFileHandle::Init()
266
{
273
{
267
   bool success = mFile->set_filename(OSFILENAME(mName));
274
#ifdef LEGACY_FLAC
268
   if (!success) {
275
   if (!mFile->set_filename(OSFILENAME(mName))) return false;
269
      return false;
276
#endif
270
   }
277
#ifdef LEGACY_FLAC
271
   FLAC::Decoder::File::State state = mFile->init();
278
   if (mFile->init() != FLAC__FILE_DECODER_OK)
272
   if (state != FLAC__FILE_DECODER_OK) {
279
#else
280
   if (mFile->init(OSFILENAME(mName)) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
281
#endif
273
      return false;
282
      return false;
274
   }
275
   mFile->process_until_end_of_metadata();
283
   mFile->process_until_end_of_metadata();
276
   state = mFile->get_state();
284
#ifdef LEGACY_FLAC
277
   if (state != FLAC__FILE_DECODER_OK) {
285
   if (mFile->get_state() != FLAC__FILE_DECODER_OK)
286
#else
287
   if (!mFile->get_state())
288
#endif
278
      return false;
289
      return false;
279
   }
280
   if (!mFile->is_valid() || mFile->get_was_error())
290
   if (!mFile->is_valid() || mFile->get_was_error())
281
   {
291
   {
282
      // This probably is not a FLAC file at all
292
      // This probably is not a FLAC file at all
Lines 340-346 Link Here
340
      mChannels[1]->SetTeamed(true);
350
      mChannels[1]->SetTeamed(true);
341
   }
351
   }
342
352
353
#ifdef LEGACY_FLAC
343
   mFile->process_until_end_of_file();
354
   mFile->process_until_end_of_file();
355
#else
356
   mFile->process_until_end_of_stream();
357
#endif
344
   
358
   
345
   *outTracks = new Track *[*outNumTracks];
359
   *outTracks = new Track *[*outNumTracks];
346
   for(c = 0; c < *outNumTracks; c++) {
360
   for(c = 0; c < *outNumTracks; c++) {

Return to bug 10868