Discussion:
[PATCH 1/3] ao: allow compilation with libao < 1.0.0
Johannes Weißl
2011-05-31 13:53:18 UTC
Permalink
---
ao.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/ao.c b/ao.c
index 57f9f47..955416a 100644
--- a/ao.c
+++ b/ao.c
@@ -30,6 +30,10 @@
#include <strings.h>
#include <ao/ao.h>

+#ifdef AO_EBADFORMAT
+#define AO_API_1
+#endif
+
static ao_device *libao_device;
static char *wav_dir = NULL;
static int wav_counter = 1;
@@ -76,6 +80,7 @@ static const struct {
{ CHANNEL_POSITION_INVALID, "X" },
};

+#ifdef AO_API_1
static char *ao_channel_matrix(int channels, const channel_position_t *map)
{
int i, j;
@@ -102,6 +107,7 @@ static char *ao_channel_matrix(int channels, const channel_position_t *map)

return xstrdup(buf);
}
+#endif

static int op_ao_open(sample_format_t sf, const channel_position_t *channel_map)
{
@@ -110,7 +116,9 @@ static int op_ao_open(sample_format_t sf, const channel_position_t *channel_map)
.rate = sf_get_rate(sf),
.channels = sf_get_channels(sf),
.byte_format = sf_get_bigendian(sf) ? AO_FMT_BIG : AO_FMT_LITTLE,
+#ifdef AO_API_1
.matrix = ao_channel_matrix(sf_get_channels(sf), channel_map)
+#endif
};
int driver;

@@ -159,7 +167,9 @@ static int op_ao_open(sample_format_t sf, const channel_position_t *channel_map)
}
}

+#ifdef AO_API_1
d_print("channel matrix: %s\n", format.matrix ? format.matrix : "default");
+#endif
return 0;
}
--
1.7.5.3
Loading...