diff options
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | src/audio.c | 5 | ||||
-rw-r--r-- | src/audio.h | 5 |
3 files changed, 19 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index de8a9ff..864792c 100644 --- a/configure.ac +++ b/configure.ac @@ -39,7 +39,15 @@ PKG_CHECK_MODULES(PROTOBUF, [libprotobuf-c],[], [ PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.28]) PKG_CHECK_MODULES(GIO, [gio-2.0]) PKG_CHECK_MODULES(GSTREAMER, [gstreamer-0.10 gstreamer-app-0.10]) -PKG_CHECK_MODULES(CELT, [celt]) +PKG_CHECK_MODULES(CELT, [celt], [have_celt=yes], [have_celt=no]) +if test "x$have_celt" = xno; then + PKG_CHECK_MODULES(CELT, [celt071], [have_celt071=yes], [have_celt071=no]) + if test "x$have_celt071" = xno; then + AC_MSG_ERROR([Neither celt nor celt071 found.]) + fi + AC_DEFINE([HAVE_CELT071], [1], [Defined if we're using celt071]) +fi + GST_ELEMENTS="appsrc appsink celtdec celtenc capsfilter audioconvert audioresample autoaudiosrc autoaudiosink" diff --git a/src/audio.c b/src/audio.c index 65af769..cf18c78 100644 --- a/src/audio.c +++ b/src/audio.c @@ -211,7 +211,12 @@ setup_playback_gst_pipeline(struct cmumble *cm) { cm->audio.celt_mode = celt_mode_create(SAMPLERATE, SAMPLERATE / 100, NULL); + +#ifdef HAVE_CELT_071 celt_header_init(&cm->audio.celt_header, cm->audio.celt_mode, CHANNELS); +#else + celt_header_init(&cm->audio.celt_header, cm->audio.celt_mode, SAMPLERATE/100, CHANNELS); +#endif celt_header_to_packet(&cm->audio.celt_header, cm->audio.celt_header_packet, sizeof(CELTHeader)); diff --git a/src/audio.h b/src/audio.h index 1e1c47c..0f7aaa2 100644 --- a/src/audio.h +++ b/src/audio.h @@ -8,8 +8,13 @@ #include <gst/app/gstappsink.h> #include <gst/app/gstappbuffer.h> +#ifdef HAVE_CELT071 +#include <celt071/celt.h> +#include <celt071/celt_header.h> +#else #include <celt/celt.h> #include <celt/celt_header.h> +#endif struct cmumble_audio { GstElement *record_pipeline; |