From patchwork Sun Sep 20 17:17:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Volker_R=C3=BCmelin?= X-Patchwork-Id: 1367948 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=t-online.de Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BvZ9y1lkHz9sSf for ; Mon, 21 Sep 2020 03:21:40 +1000 (AEST) Received: from localhost ([::1]:52136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kK31u-0007Xi-52 for incoming@patchwork.ozlabs.org; Sun, 20 Sep 2020 13:21:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kK2yN-00043K-Fy for qemu-devel@nongnu.org; Sun, 20 Sep 2020 13:18:00 -0400 Received: from mailout11.t-online.de ([194.25.134.85]:51116) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kK2yL-0006HF-SA for qemu-devel@nongnu.org; Sun, 20 Sep 2020 13:17:59 -0400 Received: from fwd40.aul.t-online.de (fwd40.aul.t-online.de [172.20.26.139]) by mailout11.t-online.de (Postfix) with SMTP id 9C2864256C51; Sun, 20 Sep 2020 19:17:56 +0200 (CEST) Received: from linpower.localnet (G-LqO6ZFQhtVJ4wGXZSDSgM57BRmZT9PIPGCSOpjRa-ikfuzLDr7U2cPpbnkf3YQ6z@[93.236.144.216]) by fwd40.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1kK2yF-3uB8XQ0; Sun, 20 Sep 2020 19:17:51 +0200 Received: by linpower.localnet (Postfix, from userid 1000) id 07EFC33550C; Sun, 20 Sep 2020 19:17:30 +0200 (CEST) From: =?utf-8?q?Volker_R=C3=BCmelin?= To: Gerd Hoffmann Subject: [PATCH 9/9] audio: revert tests for pcm_ops table Date: Sun, 20 Sep 2020 19:17:29 +0200 Message-Id: <20200920171729.15861-9-vr_qemu@t-online.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <84f1c61a-8399-c75e-96c2-febfc2dd5fab@t-online.de> References: <84f1c61a-8399-c75e-96c2-febfc2dd5fab@t-online.de> MIME-Version: 1.0 X-ID: G-LqO6ZFQhtVJ4wGXZSDSgM57BRmZT9PIPGCSOpjRa-ikfuzLDr7U2cPpbnkf3YQ6z X-TOI-EXPURGATEID: 150726::1600622271-00001797-BE7FCD5B/0/0 CLEAN NORMAL X-TOI-MSGID: fb6186ab-3716-4ad8-81f2-02470f0e43e6 Received-SPF: none client-ip=194.25.134.85; envelope-from=volker.ruemelin@t-online.de; helo=mailout11.t-online.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/20 13:17:31 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" With previous commit every audio backend has a pcm_ops function table. It's no longer necessary to test if the table is available. This reverts commit cbaf25d1f5: "audio: fix wavcapture segfault" Signed-off-by: Volker RĂ¼melin --- audio/audio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index b908e041dd..f63781b4db 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -649,7 +649,7 @@ static size_t audio_pcm_sw_read(SWVoiceIn *sw, void *buf, size_t size) total += isamp; } - if (hw->pcm_ops && !hw->pcm_ops->volume_in) { + if (!hw->pcm_ops->volume_in) { mixeng_volume (sw->buf, ret, &sw->vol); } @@ -743,7 +743,7 @@ static size_t audio_pcm_sw_write(SWVoiceOut *sw, void *buf, size_t size) if (samples) { sw->conv(sw->buf, buf, samples); - if (sw->hw->pcm_ops && !sw->hw->pcm_ops->volume_out) { + if (!sw->hw->pcm_ops->volume_out) { mixeng_volume(sw->buf, samples, &sw->vol); } }