From patchwork Sat Sep 13 18:30:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Patrakov X-Patchwork-Id: 4900061 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C00D2BEEA5 for ; Sat, 13 Sep 2014 18:36:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DCFE4201F2 for ; Sat, 13 Sep 2014 18:36:29 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 6EBAC201C8 for ; Sat, 13 Sep 2014 18:36:28 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 341372650B0; Sat, 13 Sep 2014 20:36:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id AFD8D261B2D; Sat, 13 Sep 2014 20:32:11 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id C998F265744; Sat, 13 Sep 2014 20:32:10 +0200 (CEST) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) by alsa0.perex.cz (Postfix) with ESMTP id 96F0F261ACB for ; Sat, 13 Sep 2014 20:31:02 +0200 (CEST) Received: by mail-la0-f43.google.com with SMTP id gi9so2633097lab.16 for ; Sat, 13 Sep 2014 11:30:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uCcxN0yWhkCJVmDUIHHanKzKW7nKM5DlqDKQap8HV9c=; b=Nul/HInydtZf7Ac1YPlu+h91AYn/cu0iAbQcxE2yoqvnFvho+2jT83x2U8u1LCK1oz qx4lEzZM3RYwqKZSNvkS3/5tkJ6az92WZv96bUmFQqCLH3A5TyZvhqD24zu6txSw50kA jnbt4+EuKUfc7X7NseFcwo513qXruJ5CaUi7P5FSprkaOv8cjEPbq1yPpBN7keWvLQaA DCz6nNHzpfM6tOXwxGEFlEIDnikHJu/syj1LS8PN+q10uyRoLAmAIoqE0OD0kdW471hW qDu+SHk2+mr2vStHDBcqutHSSw56rbZdIDcRtBGOHJ4w7HR4ovl7uoCMWYkgrPEIgpTH QkPw== X-Received: by 10.112.63.71 with SMTP id e7mr16368376lbs.89.1410633056202; Sat, 13 Sep 2014 11:30:56 -0700 (PDT) Received: from localhost.localdomain (111279190.convex.ru. [82.193.153.141]) by mx.google.com with ESMTPSA id pc2sm2567718lbb.5.2014.09.13.11.30.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 13 Sep 2014 11:30:55 -0700 (PDT) From: "Alexander E. Patrakov" To: alsa-devel@alsa-project.org Date: Sun, 14 Sep 2014 00:30:19 +0600 Message-Id: <1410633021-20395-8-git-send-email-patrakov@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1410633021-20395-1-git-send-email-patrakov@gmail.com> References: <1410633021-20395-1-git-send-email-patrakov@gmail.com> Cc: tiwai@suse.de, clemens@ladisch.de, "Alexander E. Patrakov" Subject: [alsa-devel] [PATCH 7/9] dsnoop: rewindable and forwardable logic was swapped X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Alexander E. Patrakov --- src/pcm/pcm_dsnoop.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c index e56e402..8333eef 100644 --- a/src/pcm/pcm_dsnoop.c +++ b/src/pcm/pcm_dsnoop.c @@ -335,7 +335,7 @@ static int snd_pcm_dsnoop_pause(snd_pcm_t *pcm ATTRIBUTE_UNUSED, int enable ATTR static snd_pcm_sframes_t snd_pcm_dsnoop_rewindable(snd_pcm_t *pcm) { - return snd_pcm_mmap_capture_avail(pcm); + return snd_pcm_mmap_capture_hw_avail(pcm); } static snd_pcm_sframes_t snd_pcm_dsnoop_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames) @@ -351,7 +351,7 @@ static snd_pcm_sframes_t snd_pcm_dsnoop_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t static snd_pcm_sframes_t snd_pcm_dsnoop_forwardable(snd_pcm_t *pcm) { - return snd_pcm_mmap_capture_hw_avail(pcm); + return snd_pcm_mmap_capture_avail(pcm); } static snd_pcm_sframes_t snd_pcm_dsnoop_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames) @@ -359,8 +359,6 @@ static snd_pcm_sframes_t snd_pcm_dsnoop_forward(snd_pcm_t *pcm, snd_pcm_uframes_ snd_pcm_sframes_t avail; avail = snd_pcm_dsnoop_forwardable(pcm); - if (avail < 0) - return 0; if (frames > (snd_pcm_uframes_t)avail) frames = avail; snd_pcm_mmap_appl_forward(pcm, frames);