From ebcbcb174bd65aa5aad944337573b1057b68f7ea Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 3 Feb 2009 03:35:23 +0100 Subject: register a few new PA error codes --- src/pulse.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/pulse.c b/src/pulse.c index 91aee9c..77a6c87 100644 --- a/src/pulse.c +++ b/src/pulse.c @@ -166,12 +166,27 @@ static int translate_error(int error) { [PA_ERR_BADSTATE] = CA_ERROR_STATE, [PA_ERR_NODATA] = CA_ERROR_IO, [PA_ERR_VERSION] = CA_ERROR_NOTSUPPORTED, - [PA_ERR_TOOLARGE] = CA_ERROR_TOOBIG + [PA_ERR_TOOLARGE] = CA_ERROR_TOOBIG, +#ifdef PA_ERR_NOTSUPPORTED + [PA_ERR_NOTSUPPORTED] = CA_ERROR_NOTSUPPORTED, +#endif +#ifdef PA_ERR_UNKNOWN + [PA_ERR_UNKNOWN] = CA_ERROR_IO, +#endif +#ifdef PA_ERR_NOEXTENSION + [PA_ERR_NOEXTENSION] = CA_ERROR_NOTSUPPORTED, +#endif +#ifdef PA_ERR_OBSOLETE + [PA_ERR_OBSOLETE] = CA_ERROR_NOTSUPPORTED, +#endif +#ifdef PA_ERR_NOTIMPLEMENTED + [PA_ERR_NOTIMPLEMENTED] = CA_ERROR_NOTSUPPORTED +#endif }; ca_assert(error >= 0); - if (error >= PA_ERR_MAX) + if (error >= PA_ERR_MAX || !table[error]) return CA_ERROR_IO; return table[error]; @@ -572,7 +587,7 @@ static void stream_write_cb(pa_stream *s, size_t bytes, void *userdata) { goto finish; } - data = NULL; + data = NULL; bytes -= rbytes; } -- cgit