From patchwork Mon Apr 3 14:33:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Bouron X-Patchwork-Id: 3265 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.44.195 with SMTP id s186csp63154vss; Mon, 3 Apr 2017 05:41:15 -0700 (PDT) X-Received: by 10.28.4.144 with SMTP id 138mr6378943wme.112.1491223275505; Mon, 03 Apr 2017 05:41:15 -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 66si19809831wrb.134.2017.04.03.05.41.15; Mon, 03 Apr 2017 05:41:15 -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; 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 C85E7688388; Mon, 3 Apr 2017 15:41:10 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6E165688282 for ; Mon, 3 Apr 2017 15:41:04 +0300 (EEST) Received: by mail-wr0-f195.google.com with SMTP id p52so33321441wrc.2 for ; Mon, 03 Apr 2017 05:41:06 -0700 (PDT) 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=IJjs4VaQLg+DzcvJJiM6YrzeHVRx08adTYApXKbpyhs=; b=HqjiZwyLNMbEAIdc9Q9BxGCR5m05Pz7e3GAoCZ6PRXie3jurgFSaKgZDrwmFmoDsDm z89hel0tzkHOE/QcyhmVyEG29j6ykIupjYJzlyQFLobGUjioPFadajnN25Qv7s7ErRVo /PxlXauszujKOiWP3CrE0+/QQcdRx4oG9FIFNHw9bKg4ZGFoy7TD/cKobchQUG69/aIy iVx8yzLZwi/Tps7CKldDTY3ZuRX9RPudYVlI4eoXkVemoLfqqR3dSQpO2zyfjfNzw3dn FGrLgA7uJSw2ZuA7vjUkhSCV+n05nOIyMbPjO3Pp7rd19p+Yc7O00WhnefgCtt5eY/N/ X+gw== 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=IJjs4VaQLg+DzcvJJiM6YrzeHVRx08adTYApXKbpyhs=; b=LEU+sZKSJOOSu4vmihhRqw9gSZiGFhb86S1VZQzsZSyP5WpIYLGSjSbLJCj+L97opK VFVZEf/N9DsUn2YjAQZak1zQsXz3bMxClW8hcj3gXsqgvv8miOUoklwnTHlRUdx9hu9u h2C0O3b6jJhu8Q65m459rqQR1IHdYGIWGpUcAzAlUa5rHiKFroh22yph1IQBejaPIoWr vF3A15u6cBPQW5VaJKCFSZa8pYix83eWKa64+8/ry3+ecuLfPXrnVXUcVswUNyzF/oQh aYL9drHRe5C8xU/P5efmEGqz703uDyp4nihav9eHRc1Mxf1P4LZcY/cxgldGgSU7h5Ug q5IQ== X-Gm-Message-State: AFeK/H2qYr98uiNyzHeX/urqfE3JsG2vTzRpefK/73oSDbESwhjO8kpZ MYhODQStwytj6A== X-Received: by 10.28.63.22 with SMTP id m22mr9723004wma.142.1491222827735; Mon, 03 Apr 2017 05:33:47 -0700 (PDT) Received: from boken.gopro.lcl (LPuteaux-656-1-74-135.w80-12.abo.wanadoo.fr. [80.12.80.135]) by smtp.gmail.com with ESMTPSA id o22sm3183438wro.45.2017.04.03.05.33.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 05:33:47 -0700 (PDT) From: Matthieu Bouron To: ffmpeg-devel@ffmpeg.org Date: Mon, 3 Apr 2017 16:33:56 +0200 Message-Id: <20170403143357.10803-2-matthieu.bouron@gmail.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170403143357.10803-1-matthieu.bouron@gmail.com> References: <20170403143357.10803-1-matthieu.bouron@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/3] doc/examples/extract_mvs: make pkt local to the main function 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: Matthieu Bouron MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- doc/examples/extract_mvs.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/doc/examples/extract_mvs.c b/doc/examples/extract_mvs.c index d6730db3a2..552a7334cf 100644 --- a/doc/examples/extract_mvs.c +++ b/doc/examples/extract_mvs.c @@ -31,13 +31,11 @@ static const char *src_filename = NULL; static int video_stream_idx = -1; static AVFrame *frame = NULL; -static AVPacket pkt; static int video_frame_count = 0; -static int decode_packet(void) +static int decode_packet(const AVPacket *pkt) { - if (pkt.stream_index == video_stream_idx) { - int ret = avcodec_send_packet(video_dec_ctx, &pkt); + int ret = avcodec_send_packet(video_dec_ctx, pkt); if (ret < 0) { fprintf(stderr, "Error while sending a packet to the decoder: %s\n", av_err2str(ret)); return ret; @@ -71,7 +69,6 @@ static int decode_packet(void) av_frame_unref(frame); } } - } return 0; } @@ -124,6 +121,7 @@ static int open_codec_context(AVFormatContext *fmt_ctx, enum AVMediaType type) int main(int argc, char **argv) { int ret = 0; + AVPacket pkt = { 0 }; if (argc != 2) { fprintf(stderr, "Usage: %s