From patchwork Tue Mar 31 12:37:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 18540 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 2243544AF30 for ; Tue, 31 Mar 2020 15:46:54 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 025A268B3FF; Tue, 31 Mar 2020 15:46:54 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EC953687F83 for ; Tue, 31 Mar 2020 15:46:51 +0300 (EEST) Received: by mail-wm1-f68.google.com with SMTP id f6so2442261wmj.3 for ; Tue, 31 Mar 2020 05:46:51 -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 :mime-version:content-transfer-encoding; bh=73nGi3LFAYMP8av6MCoc8FPukLJVT2nIptqZSydlo7k=; b=HyYknrDbWqu7DrSTXnpC4Nm1TqACFznW9C7nxtu5kcUt72h643c4BAcVXGKNzDnkCl wIGwoKka4JZFe44PBXNUle6ykNAfQYZKk/YrdU8uyUN7XsxXjQYaTpVfLcB0aVxHoLVI jfEwvg/As5uW4SqrcDYBFrdcSj2t0XaULDDhrx/TrkOEk/7HRdOdb9erg5Q073gDq4GY CE8QmTKfvOE1mil4yEx+X4E+HftJpEkxT47dq5bCSPcVCFlEHo0fb8qbiMlb3Em/R7Zl 0m8Uy0+T/8VEuQkrRs0bj7/AoFM2DNdjm4pmSvgNzf+d1w8GWV9CvFHoghDwMpz/ckg3 CXjg== 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:mime-version:content-transfer-encoding; bh=73nGi3LFAYMP8av6MCoc8FPukLJVT2nIptqZSydlo7k=; b=Q19laCg2RKGfpuNWrqL0zYV6uBQ/jlD/0yd3GSRACwffrJANBL21mDZJQMyWGSKBAp NFLWfCCs/zFzUbFd5TLi4Mo+gX/3U5VUG7LIYoaHwjhkiR8ufKAKjb+nsKtkUQFyphuD RljX3WcLxnm12BBnv5q0ufURY/gnERuyOnTqlSIx+hi1wZOUMP/0bObQdiE8gHX//uWz vSEGQwF2VWIKZ/AKLOChQycu+JEK5wEJCy4nlp5Tu4eYad6yPdvC1FGO1dslVMlTaZ0S 02Gew+4ECykEjYGqLdqg7dX7VD+X0NP6oniMLALvkxJtxPGugsojGlpqSj0LMEX5cX3Q 3uIA== X-Gm-Message-State: ANhLgQ3bAhGjNy2aKVl9H+x5x+nYfiDadI/rV7X2CVCdAT9OEWg4y64R KTk6fKk1M9eg/nIG+agzwPp3LGNc X-Google-Smtp-Source: ADFU+vuBchFAQ0jcrEnu1YleNHznrIk5362hVrs31XEcL0UGUuzyczbCuu/zJWGvzjNhHtAXIXlyrw== X-Received: by 2002:a1c:6285:: with SMTP id w127mr3458043wmb.133.1585658317611; Tue, 31 Mar 2020 05:38:37 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1ab57.dynamic.kabel-deutschland.de. [188.193.171.87]) by smtp.gmail.com with ESMTPSA id p13sm26301532wru.3.2020.03.31.05.38.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Mar 2020 05:38:36 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 31 Mar 2020 14:37:45 +0200 Message-Id: <20200331123745.6461-11-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200331123745.6461-1-andreas.rheinhardt@gmail.com> References: <20200331123745.6461-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 10/10] libavformat/mux, mxfenc: Don't initialize unnecessarily 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" When no packet could be output, the interleavement functions nevertheless initialized the packet destined for output (with the exception of the data and size fields, making the initialization pointless), although it will not be used at all. So remove the initializations. Signed-off-by: Andreas Rheinhardt --- libavformat/internal.h | 4 ++-- libavformat/mux.c | 1 - libavformat/mxfenc.c | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/libavformat/internal.h b/libavformat/internal.h index a861acdc2a..7a01c25ea1 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -504,8 +504,8 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt); * (as if unreferenced) on success. * @param flush 1 if no further packets are available as input and all * remaining packets should be output - * @return 1 if a packet was output, 0 if no packet could be output, - * < 0 if an error occurred + * @return 1 if a packet was output, 0 if no packet could be output + * (in which case out may be uninitialized), < 0 if an error occurred */ int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush); diff --git a/libavformat/mux.c b/libavformat/mux.c index acb71b30c9..034cc0b0ab 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -1147,7 +1147,6 @@ int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, return 1; } else { - av_init_packet(out); return 0; } } diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index bfce531f54..23147e9b84 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -3070,7 +3070,6 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket return 1; } else { out: - av_init_packet(out); return 0; } }