diff options
author | David Henningsson <david.henningsson@canonical.com> | 2014-07-01 07:55:38 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-07-01 11:23:12 +0200 |
commit | c9b23c1a71a35e7fb5f455f996622d21fdd9619e (patch) | |
tree | 0b625ee776f1cee1701412ab292b28c40df889b4 | |
parent | 5b80a482bda5a716556303c0cc013e70aaaedef1 (diff) | |
download | hda-emu-c9b23c1a71a35e7fb5f455f996622d21fdd9619e.tar.gz |
Adapt to new snd_hda_calc_stream_format
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | configure.ac | 23 | ||||
-rw-r--r-- | hda-emu.c | 6 |
2 files changed, 28 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 31b31cd..fe5c0e2 100644 --- a/configure.ac +++ b/configure.ac @@ -488,6 +488,29 @@ if test "$STREAM_FORMAT_WITH_SPDIF" = "1"; then fi fi +AC_MSG_CHECKING(for snd_hda_calc_stream_format with codec) +ac_save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Iinclude" +STREAM_FORMAT_WITH_CODEC= +AC_TRY_COMPILE([ +#include "hda-types.h" +#include "hda-log.h" +#include <sound/driver.h> +#include <sound/core.h> +#include <sound/pcm.h> +#include "hda/hda_codec.h" +],[ + snd_hda_calc_stream_format(0, 0, 0, 0, 0, 0); +], + [AC_MSG_RESULT(yes); STREAM_FORMAT_WITH_CODEC="1"], + [AC_MSG_RESULT(no)], + [AC_MSG_RESULT(unknown)] +) +CFLAGS=$ac_save_CFLAGS +if test "$STREAM_FORMAT_WITH_CODEC" = "1"; then + AC_DEFINE(STREAM_FORMAT_WITH_CODEC) +fi + HAVE_COMMON_PREPARE= AC_MSG_CHECKING(for common snd_hda_codec_prepare/cleanup) if grep -q snd_hda_codec_prepare hda/hda_codec.h; then @@ -798,7 +798,11 @@ void hda_test_pcm(int id, int op, int subid, hda_log(HDA_LOG_INFO, "Prepare PCM, rate=%d, channels=%d, " "format=%d bits\n", rate, channels, format); - format_val = snd_hda_calc_stream_format(rate, channels, + format_val = snd_hda_calc_stream_format( +#if defined(STREAM_FORMAT_WITH_CODEC) + _codec, +#endif + rate, channels, get_alsa_format(format), format #if defined(INDIVIDUAL_SPDIF_CTLS) || defined(STREAM_FORMAT_WITH_SPDIF) |