Fixed some logic on the 1.0.3->1.0.4 compatibility
[platform/upstream/gst-plugins-good.git] / ext / flac / flac_compat.h
1
2 /* This file is an attempt to hack compatibility between the
3  * FLAC API version used in the code in this directory
4  * (currently 1.0.3) and older versions of FLAC, particularly
5  * 1.0.2.
6  */
7
8 #ifndef _FLAC_COMPAT_H_
9 #define _FLAC_COMPAT_H_
10
11 #include <FLAC/all.h>
12
13 /* FIXME when there's a autoconf symbol */
14 #ifndef FLAC_VERSION
15
16 #ifndef FLAC__STREAM_ENCODER_WRITE_OK
17 #define FLAC_VERSION 0x010004
18 #else
19 #ifdef FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE
20 #define FLAC_VERSION 0x010003
21 #else
22 #define FLAC_VERSION 0x010002
23 #endif
24 #endif
25
26 #endif /* !defined(FLAC_VERSION) */
27
28 #if FLAC_VERSION < 0x010004
29 #define FLAC__STREAM_ENCODER_OK FLAC__STREAM_ENCODER_WRITE_OK
30 #define FLAC__seekable_stream_decoder_process_single(a) \
31         FLAC__seekable_stream_decoder_process_one_frame(a)
32 #endif /* FLAC_VERSION < 0x010004 */
33
34 #if FLAC_VERSION < 0x010003
35
36 #define FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC \
37         FLAC__STREAM_DECODER_ERROR_LOST_SYNC
38 #define FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER \
39         FLAC__STREAM_DECODER_ERROR_BAD_HEADER
40 #define FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH \
41         FLAC__STREAM_DECODER_ERROR_FRAME_CRC_MISMATCH
42 #define FLAC__STREAM_DECODER_WRITE_STATUS_ABORT \
43         FLAC__STREAM_DECODER_WRITE_ABORT
44 #define FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE \
45         FLAC__STREAM_DECODER_WRITE_CONTINUE
46
47 #define FLAC__StreamMetadata FLAC__StreamMetaData
48
49 #endif /* FLAC_VERSION < 0x010003 */
50
51 #endif /* _FLAC_COMPAT_H_ */