From patchwork Fri Oct 21 13:31:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 1099 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.133 with SMTP id o127csp1070743vsd; Fri, 21 Oct 2016 06:32:16 -0700 (PDT) X-Received: by 10.194.170.163 with SMTP id an3mr801904wjc.73.1477056736540; Fri, 21 Oct 2016 06:32:16 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id k7si2611287wjs.211.2016.10.21.06.32.15; Fri, 21 Oct 2016 06:32:16 -0700 (PDT) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DA4F0689C42; Fri, 21 Oct 2016 16:31:53 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe01-1.mx.upcmail.net (vie01a-dmta-pe01-1.mx.upcmail.net [62.179.121.154]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 80E5268925F for ; Fri, 21 Oct 2016 16:31:47 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe01.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1bxZvK-0003yC-KT for ffmpeg-devel@ffmpeg.org; Fri, 21 Oct 2016 15:31:50 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id yDXp1t00h0S5wYM01DXqc5; Fri, 21 Oct 2016 15:31:50 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 21 Oct 2016 15:31:42 +0200 Message-Id: <20161021133146.11956-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161021133146.11956-1-michael@niedermayer.cc> References: <20161021133146.11956-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 3/7] avcodec/utils: Move emms_c() before memory allocation functions in avcodec_encode_video2() 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- libavcodec/utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 7da6a66..7c26485 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1994,6 +1994,8 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx, ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr); av_assert0(ret <= 0); + emms_c(); + if (avpkt->data && avpkt->data == avctx->internal->byte_buffer) { needs_realloc = 0; if (user_pkt.data) { @@ -2031,7 +2033,6 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx, if (ret < 0 || !*got_packet_ptr) av_packet_unref(avpkt); - emms_c(); return ret; }