From patchwork Sat Jan 28 15:23:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Faiz X-Patchwork-Id: 2347 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp725368vsb; Sat, 28 Jan 2017 07:26:27 -0800 (PST) X-Received: by 10.28.136.13 with SMTP id k13mr7682921wmd.94.1485617187455; Sat, 28 Jan 2017 07:26:27 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id p69si9897460wrb.124.2017.01.28.07.26.26; Sat, 28 Jan 2017 07:26:27 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A736968A245; Sat, 28 Jan 2017 17:26:22 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EB3E068A17A for ; Sat, 28 Jan 2017 17:26:15 +0200 (EET) Received: by mail-pf0-f195.google.com with SMTP id e4so20399708pfg.0 for ; Sat, 28 Jan 2017 07:26:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Uir89dXpBHvxvVGpLPnq0qcrxJFgxUZlQfIAIgiSgYI=; b=YkCbcclkcGTLY0UKItX2A/fjGkn5LKqp75vCLf0c5YhBjUIKyB+Jt6csQqFRQVvkkq kRuu2jUDJTcZA9Bc0HvhCHGTIvz8sV92o1hwf8cCqtia4G74+Eo0I/hL3uXKJRwnUZr3 CLfI44My970pR4aQVOGvMorP7kNetiXtmTpPK9nx56EPNcTM0wAkXETtHNreZemOQMGy lrecHatUfcGaF07gM99zVYDQNinqC4g090aUSCxGHrSl/7BdCRNIvENJiyfGbwtkUeto Fo7VrFRVAc4YX8A7eV7CzTgAy21cdYWDKHubD+dDM87ntWEWHA36AGB/oYednpp6W+KE p97g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Uir89dXpBHvxvVGpLPnq0qcrxJFgxUZlQfIAIgiSgYI=; b=SxwEbU/n5yWbHl5gLSMAEgXFU0UzmvyhsSip65N8J89GsfyAapmthdS1suDcL0HXsN m42NkUjF73mHfZDBE3Nc3UrKjChLqtnfttp9+9e7yM9hBpk18YdjOOsGk9Kl2SDFQ6GZ UIWwywtuVl0hcVGnHZHfKjftizx5Ics+tN2hNu6DDMv7qNbWIwt4xc+yJL9gtUNruG13 dg1R2/z68Q6PQLg5hAz+NPkFM0kTZb67yTkUsuR+8XGKkOahnLCGSa5MTOBmyh8divy+ xE9u1xNywfRdqI6h6SpBvMK5lyd2sRSV5+cpw4MlLmTKOqWrnBMKXrlbWO2Sg//uU/Rz sdqQ== X-Gm-Message-State: AIkVDXITZ7ZjPCyv1NIT63axHTZB2iy0OZizrjhL3ETzonpeZxXJrQ2He4Xu5M7tM0XZzA== X-Received: by 10.99.107.130 with SMTP id g124mr14993281pgc.108.1485617175969; Sat, 28 Jan 2017 07:26:15 -0800 (PST) Received: from localhost.localdomain.localdomain ([202.67.46.251]) by smtp.gmail.com with ESMTPSA id f3sm19842092pga.34.2017.01.28.07.26.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Jan 2017 07:26:15 -0800 (PST) From: Muhammad Faiz To: ffmpeg-devel@ffmpeg.org Date: Sat, 28 Jan 2017 22:23:54 +0700 Message-Id: <1485617034-31431-2-git-send-email-mfcc64@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1485617034-31431-1-git-send-email-mfcc64@gmail.com> References: <1485617034-31431-1-git-send-email-mfcc64@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/2] avfilter: make frame writable before writing it X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Muhammad Faiz MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" affect filters that set partial_buf_size test-case ffplay -i lavfi 'aevalsrc=sin(1000*t*t), aformat=sample_fmts=fltp, asplit [a][b]; [a] firequalizer=fixed=on, showcqt=s=1280x360 [a1]; [b] firequalizer=fixed=on, showcqt=s=1280x360 [b1]; [a1][b1] vstack' Signed-off-by: Muhammad Faiz --- libavfilter/avfilter.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index c8dafd2..55c653d 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -1235,6 +1235,11 @@ static int take_samples(AVFilterLink *link, unsigned min, unsigned max, frame = ff_framequeue_peek(&link->fifo, 0); av_samples_copy(buf->extended_data, frame->extended_data, p, 0, n, link->channels, link->format); + + ret = ff_inlink_make_frame_writable(link, frame); + if (ret < 0) + return ret; + frame->nb_samples -= n; av_samples_copy(frame->extended_data, frame->extended_data, 0, n, frame->nb_samples, link->channels, link->format);