mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
To: perex@perex.cz, tiwai@suse.com
Cc: rosen@gmail.com, cezary.rojewski@intel.com, tim.bird@sony.com,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sreeraj S Kurup <sreekuttan2156239@gmail.com>
Subject: [PATCH] ALSA: pcm: Fix source frame count calculation
Date: Mon,  2 Nov 2026 14:16:47 +0000	[thread overview]
Message-ID: <20261102141647.3133-1-sreekuttan2156239@gmail.com> (raw)

Pass the updated frame count to the "src_frames()" callback.

When the next plugin handles fewer frames than requested, use the
actual frame count instead of the original requested count.

This ensures the correct number of source frames is calculated.

Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
---
 sound/core/oss/pcm_plugin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c
index acf5ca663ba8..3de713779993 100644
--- a/sound/core/oss/pcm_plugin.c
+++ b/sound/core/oss/pcm_plugin.c
@@ -604,7 +604,7 @@ snd_pcm_sframes_t snd_pcm_plug_write_transfer(struct snd_pcm_substream *plug, st
 			if (err != frames1) {
 				frames = err;
 				if (plugin->src_frames) {
-					frames = plugin->src_frames(plugin, frames1);
+					frames = plugin->src_frames(plugin, err);
 					if (frames <= 0)
 						return frames;
 				}
-- 
2.55.0


             reply	other threads:[~2026-11-02 14:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02 14:16 Sreeraj S Kurup [this message]
2026-11-02 14:31 ` Takashi Iwai
2026-11-02 14:47   ` Sreeraj S Kurup
2026-11-02 15:04     ` Takashi Iwai
2026-11-02 15:40       ` Sreeraj S Kurup
2026-11-02 14:34 Sreeraj S Kurup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261102141647.3133-1-sreekuttan2156239@gmail.com \
    --to=sreekuttan2156239@gmail.com \
    --cc=cezary.rojewski@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=rosen@gmail.com \
    --cc=tim.bird@sony.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®