Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1726720/?format=api
{ "id": 1726720, "url": "http://patchwork.ozlabs.org/api/patches/1726720/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20230115131224.30751-2-volker.ruemelin@t-online.de/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20230115131224.30751-2-volker.ruemelin@t-online.de>", "list_archive_url": null, "date": "2023-01-15T13:12:09", "name": "[02/17] audio: change type and name of the resample buffer", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "4fcf6ba983014b3a67b0523d5869b8d79ba627e9", "submitter": { "id": 83211, "url": "http://patchwork.ozlabs.org/api/people/83211/?format=api", "name": "Volker Rümelin", "email": "volker.ruemelin@t-online.de" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20230115131224.30751-2-volker.ruemelin@t-online.de/mbox/", "series": [ { "id": 336714, "url": "http://patchwork.ozlabs.org/api/series/336714/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=336714", "date": "2023-01-15T13:08:29", "name": "[01/17] audio: change type of mix_buf and conv_buf", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/336714/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1726720/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1726720/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=<UNKNOWN>)", "Received": [ "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4Nvwbq2zmwz23g1\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 16 Jan 2023 00:14:31 +1100 (AEDT)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1pH2oQ-0003z7-Nn; Sun, 15 Jan 2023 08:12:38 -0500", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <volker.ruemelin@t-online.de>)\n id 1pH2oN-0003yR-SW\n for qemu-devel@nongnu.org; Sun, 15 Jan 2023 08:12:36 -0500", "from mailout06.t-online.de ([194.25.134.19])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <volker.ruemelin@t-online.de>)\n id 1pH2oL-00058l-Rd\n for qemu-devel@nongnu.org; Sun, 15 Jan 2023 08:12:35 -0500", "from fwd89.dcpf.telekom.de (fwd89.aul.t-online.de [10.223.144.115])\n by mailout06.t-online.de (Postfix) with SMTP id 16C71CB9F;\n Sun, 15 Jan 2023 14:12:32 +0100 (CET)", "from linpower.localnet ([79.208.25.151]) by fwd89.t-online.de\n with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted)\n esmtp id 1pH2oE-1wRQ810; Sun, 15 Jan 2023 14:12:27 +0100", "by linpower.localnet (Postfix, from userid 1000)\n id 55913200624; Sun, 15 Jan 2023 14:12:24 +0100 (CET)" ], "From": "=?utf-8?q?Volker_R=C3=BCmelin?= <volker.ruemelin@t-online.de>", "To": "Gerd Hoffmann <kraxel@redhat.com>", "Cc": "qemu-devel@nongnu.org", "Subject": "[PATCH 02/17] audio: change type and name of the resample buffer", "Date": "Sun, 15 Jan 2023 14:12:09 +0100", "Message-Id": "<20230115131224.30751-2-volker.ruemelin@t-online.de>", "X-Mailer": "git-send-email 2.35.3", "In-Reply-To": "<61bd351f-0683-7f58-b746-66c9578a7cdc@t-online.de>", "References": "<61bd351f-0683-7f58-b746-66c9578a7cdc@t-online.de>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "X-TOI-MSGID": "6ec5ab77-e123-4d9f-a299-965e08d05aad", "Received-SPF": "none client-ip=194.25.134.19;\n envelope-from=volker.ruemelin@t-online.de; helo=mailout06.t-online.de", "X-Spam_score_int": "-18", "X-Spam_score": "-1.9", "X-Spam_bar": "-", "X-Spam_report": "(-1.9 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001,\n SPF_NONE=0.001 autolearn=ham autolearn_force=no", "X-Spam_action": "no action", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "From: Volker Rümelin <vr_qemu@t-online.de>\n\nChange the type of the resample buffer from struct st_sample *\nto STSampleBuffer. Also change the name from buf to resample_buf\nfor better readability.\n\nThe new variables resample_buf.size and resample_buf.pos will be\nused after the next patches. There is no functional change.\n\nSigned-off-by: Volker Rümelin <vr_qemu@t-online.de>\n---\n audio/audio.c | 15 ++++++++-------\n audio/audio_int.h | 4 ++--\n audio/audio_template.h | 10 ++++++----\n 3 files changed, 16 insertions(+), 13 deletions(-)", "diff": "diff --git a/audio/audio.c b/audio/audio.c\nindex 6a17b3bb2f..22ec7d3093 100644\n--- a/audio/audio.c\n+++ b/audio/audio.c\n@@ -553,7 +553,7 @@ static size_t audio_pcm_sw_read(SWVoiceIn *sw, void *buf, size_t size)\n {\n HWVoiceIn *hw = sw->hw;\n size_t samples, live, ret = 0, swlim, isamp, osamp, rpos, total = 0;\n- struct st_sample *src, *dst = sw->buf;\n+ struct st_sample *src, *dst = sw->resample_buf.buffer;\n \n live = hw->total_samples_captured - sw->total_hw_samples_acquired;\n if (!live) {\n@@ -593,10 +593,10 @@ static size_t audio_pcm_sw_read(SWVoiceIn *sw, void *buf, size_t size)\n }\n \n if (!hw->pcm_ops->volume_in) {\n- mixeng_volume (sw->buf, ret, &sw->vol);\n+ mixeng_volume(sw->resample_buf.buffer, ret, &sw->vol);\n }\n \n- sw->clip (buf, sw->buf, ret);\n+ sw->clip(buf, sw->resample_buf.buffer, ret);\n sw->total_hw_samples_acquired += total;\n return ret * sw->info.bytes_per_frame;\n }\n@@ -704,10 +704,10 @@ static size_t audio_pcm_sw_write(SWVoiceOut *sw, void *buf, size_t size)\n samples = ((int64_t)MIN(dead, hw_free) << 32) / sw->ratio;\n samples = MIN(samples, size / sw->info.bytes_per_frame);\n if (samples) {\n- sw->conv(sw->buf, buf, samples);\n+ sw->conv(sw->resample_buf.buffer, buf, samples);\n \n if (!sw->hw->pcm_ops->volume_out) {\n- mixeng_volume(sw->buf, samples, &sw->vol);\n+ mixeng_volume(sw->resample_buf.buffer, samples, &sw->vol);\n }\n }\n \n@@ -722,7 +722,7 @@ static size_t audio_pcm_sw_write(SWVoiceOut *sw, void *buf, size_t size)\n osamp = blck;\n st_rate_flow_mix (\n sw->rate,\n- sw->buf + pos,\n+ sw->resample_buf.buffer + pos,\n sw->hw->mix_buf.buffer + wpos,\n &isamp,\n &osamp\n@@ -1059,7 +1059,8 @@ static void audio_capture_mix_and_clear(HWVoiceOut *hw, size_t rpos,\n size_t bytes = to_write * hw->info.bytes_per_frame;\n size_t written;\n \n- sw->buf = hw->mix_buf.buffer + rpos2;\n+ sw->resample_buf.buffer = hw->mix_buf.buffer + rpos2;\n+ sw->resample_buf.size = to_write;\n written = audio_pcm_sw_write (sw, NULL, bytes);\n if (written - bytes) {\n dolog(\"Could not mix %zu bytes into a capture \"\ndiff --git a/audio/audio_int.h b/audio/audio_int.h\nindex 900b0a6255..f4ec5dcf11 100644\n--- a/audio/audio_int.h\n+++ b/audio/audio_int.h\n@@ -109,7 +109,7 @@ struct SWVoiceOut {\n struct audio_pcm_info info;\n t_sample *conv;\n int64_t ratio;\n- struct st_sample *buf;\n+ STSampleBuffer resample_buf;\n void *rate;\n size_t total_hw_samples_mixed;\n int active;\n@@ -129,7 +129,7 @@ struct SWVoiceIn {\n int64_t ratio;\n void *rate;\n size_t total_hw_samples_acquired;\n- struct st_sample *buf;\n+ STSampleBuffer resample_buf;\n f_sample *clip;\n HWVoiceIn *hw;\n char *name;\ndiff --git a/audio/audio_template.h b/audio/audio_template.h\nindex 9283f00e9e..07c14e7821 100644\n--- a/audio/audio_template.h\n+++ b/audio/audio_template.h\n@@ -95,13 +95,13 @@ static void glue(audio_pcm_hw_alloc_resources_, TYPE)(HW *hw)\n \n static void glue (audio_pcm_sw_free_resources_, TYPE) (SW *sw)\n {\n- g_free (sw->buf);\n+ g_free(sw->resample_buf.buffer);\n+ sw->resample_buf.buffer = NULL;\n+ sw->resample_buf.size = 0;\n \n if (sw->rate) {\n st_rate_stop (sw->rate);\n }\n-\n- sw->buf = NULL;\n sw->rate = NULL;\n }\n \n@@ -132,7 +132,9 @@ static int glue (audio_pcm_sw_alloc_resources_, TYPE) (SW *sw)\n return -1;\n }\n \n- sw->buf = g_new0(st_sample, samples);\n+ sw->resample_buf.buffer = g_new0(st_sample, samples);\n+ sw->resample_buf.size = samples;\n+ sw->resample_buf.pos = 0;\n \n #ifdef DAC\n sw->rate = st_rate_start (sw->info.freq, sw->hw->info.freq);\n", "prefixes": [ "02/17" ] }