summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Gao <georgao@codeaurora.org>2020-12-14 15:18:58 -0800
committerGeorge Gao <georgao@codeaurora.org>2020-12-15 13:49:38 -0800
commita17899e7d409bfd958340605106c75324338f650 (patch)
treef21f764b49bdd0026163ffd77766dd1341fffee4
parent9d019c50b855ca6c5e4f6fbc43ed1dc4a3f03bb4 (diff)
tinycompress: Add conditional compilation check for compress param
This is needed for proper compilation on kernel versions where SNDRV_COMPRESS_SET_NEXT_TRACK_PARAM is not defined CRs-Fixed: 2838117 Change-Id: Ia0b2593b5dc1e0cf751ac11e64d347644b8bee39
-rw-r--r--compress.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/compress.c b/compress.c
index 5845cae..54d94d7 100644
--- a/compress.c
+++ b/compress.c
@@ -579,8 +579,13 @@ int compress_set_next_track_param(struct compress *compress,
if (!is_compress_running(compress))
return oops(compress, ENODEV, "device not ready");
+ if (codec_options == NULL)
+ return oops(compress, ENODEV, "codec_option NULL");
+
+#ifdef SNDRV_COMPRESS_SET_NEXT_TRACK_PARAM
if (ioctl(compress->fd, SNDRV_COMPRESS_SET_NEXT_TRACK_PARAM, codec_options))
return oops(compress, errno, "cannot set next track params\n");
+#endif
return 0;
}
#endif