All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][tinycompress] crecord: Use whole buffer requested by user
@ 2018-04-13 11:58 Charles Keepax
  2018-04-19  6:06 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Charles Keepax @ 2018-04-13 11:58 UTC (permalink / raw)
  To: vinod.koul; +Cc: patches, alsa-devel

Currently, crecord will only actually use 1 fragment worth of its
internal buffer no matter what the user requests. Correct this so that
the whole buffer requested by the user is used for copying data.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
 src/utils/crecord.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/utils/crecord.c b/src/utils/crecord.c
index e051c2d..8728c5d 100644
--- a/src/utils/crecord.c
+++ b/src/utils/crecord.c
@@ -370,15 +370,15 @@ static void capture_samples(char *name, unsigned int card, unsigned int device,
 	if (verbose)
 		fprintf(finfo, "%s: Opened compress device\n", __func__);
 
-	size = config.fragment_size;
-	buffer = malloc(size * config.fragments);
+	size = config.fragments * config.fragment_size;
+	buffer = malloc(size);
 	if (!buffer) {
 		fprintf(stderr, "Unable to allocate %d bytes\n", size);
 		goto comp_exit;
 	}
 
 	fprintf(finfo, "Recording file %s On Card %u device %u, with buffer of %lu bytes\n",
-	       name, card, device, buffer_size);
+	       name, card, device, size);
 	fprintf(finfo, "Codec %u Format %u Channels %u, %u Hz\n",
 	       codec.id, codec.format, codec.ch_out, rate);
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][tinycompress] crecord: Use whole buffer requested by user
  2018-04-13 11:58 [PATCH][tinycompress] crecord: Use whole buffer requested by user Charles Keepax
@ 2018-04-19  6:06 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2018-04-19  6:06 UTC (permalink / raw)
  To: Charles Keepax; +Cc: patches, alsa-devel

On Fri, Apr 13, 2018 at 12:58:59PM +0100, Charles Keepax wrote:
> Currently, crecord will only actually use 1 fragment worth of its
> internal buffer no matter what the user requests. Correct this so that
> the whole buffer requested by the user is used for copying data.

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-19  6:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-13 11:58 [PATCH][tinycompress] crecord: Use whole buffer requested by user Charles Keepax
2018-04-19  6:06 ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.