hydrogen/hydrogen-0.9.3-build-flac.patch

45 lines
1.0 KiB
Diff

--- src/lib/FLACFile.cpp.old 2007-02-11 20:12:34.000000000 +0100
+++ src/lib/FLACFile.cpp 2007-02-11 20:18:25.000000000 +0100
@@ -33,6 +33,13 @@
//#include "FLAC/file_decoder.h"
#include <FLAC++/all.h>
+#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8
+#define LEGACY_FLAC
+#else
+#undef LEGACY_FLAC
+#endif
+
+
/// Reads a FLAC file...not optimized yet
class FLACFile_real : public FLAC::Decoder::File, public Object
{
@@ -164,16 +171,28 @@
}
set_metadata_ignore_all();
+
+#ifdef LEGACY_FLAC
set_filename( sFilename.c_str() );
State s=init();
if( s != FLAC__FILE_DECODER_OK ) {
+#else
+ FLAC__StreamDecoderInitStatus s=init(sFilename.c_str() );
+ if(s!=FLAC__STREAM_DECODER_INIT_STATUS_OK) {
+#endif
errorLog( "[load] Error in init()" );
}
+#ifdef LEGACY_FLAC
if ( process_until_end_of_file() == false ) {
errorLog( "[load] Error in process_until_end_of_file()" );
}
+#else
+ if ( process_until_end_of_stream() == false ) {
+ errorLog( "[load] Error in process_until_end_of_stream()" );
+ }
+#endif
}