87b5b864a637d4daa142605b65561e5611f646bb
[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 #ifndef VERSION
12 #define VERSION bogus
13 #endif
14 #include <FLAC/all.h>
15
16 /* FIXME when there's a autoconf symbol */
17 #ifndef FLAC_VERSION
18
19 #ifndef FLAC__VERSION_STRING /* removed in 1.0.4 */
20 #define FLAC_VERSION 0x010004
21 #else
22 #ifdef FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE
23 #define FLAC_VERSION 0x010003
24 #else
25 #define FLAC_VERSION 0x010002
26 #endif
27 #endif
28
29 #endif /* !defined(FLAC_VERSION) */
30
31
32 #if FLAC_VERSION < 0x010004
33 #define FLAC__STREAM_ENCODER_OK FLAC__STREAM_ENCODER_WRITE_OK
34 #define FLAC__seekable_stream_decoder_process_single(a) \
35         FLAC__seekable_stream_decoder_process_one_frame(a)
36 #endif /* FLAC_VERSION < 0x010004 */
37
38 #if FLAC_VERSION < 0x010003
39
40 #define FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC \
41         FLAC__STREAM_DECODER_ERROR_LOST_SYNC
42 #define FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER \
43         FLAC__STREAM_DECODER_ERROR_BAD_HEADER
44 #define FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH \
45         FLAC__STREAM_DECODER_ERROR_FRAME_CRC_MISMATCH
46 #define FLAC__STREAM_DECODER_WRITE_STATUS_ABORT \
47         FLAC__STREAM_DECODER_WRITE_ABORT
48 #define FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE \
49         FLAC__STREAM_DECODER_WRITE_CONTINUE
50
51 #define FLAC__StreamMetadata FLAC__StreamMetaData
52
53 #endif /* FLAC_VERSION < 0x010003 */
54
55 #endif /* _FLAC_COMPAT_H_ */