diff options
author | Ajender Reddy <quic_ajender@quicinc.com> | 2022-02-08 00:29:15 +0530 |
---|---|---|
committer | Ajender Reddy <quic_ajender@quicinc.com> | 2022-04-04 21:30:56 +0530 |
commit | f6700a93634f3c219a40b1298d12cbbf5ebf1160 (patch) | |
tree | 8ff84f79bb871c15761516f097bf466700255858 /compress_plugin.c | |
parent | 19229ae4b561d27c4ed74e8f4ed72d1ceed67aa6 (diff) |
tinycompress: do not loop in the compress read
Return the compress read immediately when it is
successful. client can recall for the remaining bytes.
Also, In case of capture, move the plugin state
to prepared when set params is successful.
Earlier in case of playback this plug state is moved
to prepare only when first write is successful.
CRs-Fixed: 3164253
Change-Id: I2b8e2a12397682c5a17473ea06623c1152cc9819
Diffstat (limited to 'compress_plugin.c')
-rw-r--r-- | compress_plugin.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compress_plugin.c b/compress_plugin.c index 0e536cc..22f8f11 100644 --- a/compress_plugin.c +++ b/compress_plugin.c @@ -43,6 +43,7 @@ #include <linux/ioctl.h> #include <sound/asound.h> #include "tinycompress/compress_plugin.h" +#include "tinycompress/tinycompress.h" #include "sound/compress_offload.h" #include "compress_ops.h" #include "snd_utils.h" @@ -96,8 +97,11 @@ static int compress_plug_set_params(struct compress_plug_data *plug_data, return -EINVAL; rc = plugin->ops->set_params(plugin, params); - if (!rc) + if (!rc) { plugin->state = COMPRESS_PLUG_STATE_SETUP; + if (plug_data->flags & COMPRESS_OUT) + plugin->state = COMPRESS_PLUG_STATE_PREPARED; + } return rc; } |