lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230201134947.1638197-2-quic_mohs@quicinc.com>
Date:   Wed, 1 Feb 2023 19:19:34 +0530
From:   Mohammad Rafi Shaik <quic_mohs@...cinc.com>
To:     <krzysztof.kozlowski+dt@...aro.org>, <agross@...nel.org>,
        <andersson@...nel.org>, <lgirdwood@...il.com>,
        <broonie@...nel.org>, <robh+dt@...nel.org>,
        <quic_plai@...cinc.com>, <bgoswami@...cinc.com>,
        <srinivas.kandagatla@...aro.org>, <quic_rohkumar@...cinc.com>,
        <linux-arm-msm@...r.kernel.org>, <alsa-devel@...a-project.org>,
        <linux-kernel@...r.kernel.org>, <swboyd@...omium.org>,
        <judyhsiao@...omium.org>, <devicetree@...r.kernel.org>,
        <konrad.dybcio@...aro.org>
CC:     Mohammad Rafi Shaik <quic_mohs@...cinc.com>
Subject: [PATCH 01/14] ALSA: compress: Update compress set params for gapless playback

Update compress set params for supporting next track settings
during gapless playback.
Update the runtime state to setup state only if it's in open state.
Allow parameter change only when stream has been opened and running
state.

Signed-off-by: Mohammad Rafi Shaik <quic_mohs@...cinc.com>
Co-developed-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
---
 sound/core/compress_offload.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index 243acad89fd3..9b951d76c120 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -589,7 +589,8 @@ snd_compr_set_params(struct snd_compr_stream *stream, unsigned long arg)
 	struct snd_compr_params *params;
 	int retval;
 
-	if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) {
+	if (stream->runtime->state == SNDRV_PCM_STATE_OPEN ||
+			stream->runtime->state == SNDRV_PCM_STATE_RUNNING) {
 		/*
 		 * we should allow parameter change only when stream has been
 		 * opened not in other cases
@@ -612,10 +613,13 @@ snd_compr_set_params(struct snd_compr_stream *stream, unsigned long arg)
 		if (retval)
 			goto out;
 
-		stream->metadata_set = false;
-		stream->next_track = false;
+		if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) {
+			stream->metadata_set = false;
+			stream->next_track = false;
+
+			stream->runtime->state = SNDRV_PCM_STATE_SETUP;
+		}
 
-		stream->runtime->state = SNDRV_PCM_STATE_SETUP;
 	} else {
 		return -EPERM;
 	}
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ