From patchwork Sat May 9 20:18:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 19588 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 D030B44AB17 for ; Sat, 9 May 2020 23:18:25 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A876D688379; Sat, 9 May 2020 23:18:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A277C680060 for ; Sat, 9 May 2020 23:18:18 +0300 (EEST) Received: by mail-wr1-f65.google.com with SMTP id v12so5963009wrp.12 for ; Sat, 09 May 2020 13:18:18 -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:mime-version :content-transfer-encoding; bh=RupCXXLKCzpPkPpwIBA0KHI28twqjq2XUeoxKKRT2GI=; b=YjfxDzpo/G9jVX1m9/jgYA9Uh83nSxIt5TNC463KLN4HEOrYlr1ja/IFdH0DI8Yh0r GBImoVxRYBO4HJwE/binaz7To3wDDEtzn8g/d+PULmXp1GPoZw9fSBE1gv9JCvWVHtDw QciIUbhV+U+MdXH7/7WYeXIZOD58l/eAj/ia2ie9UQeBMNbkAJ5sxqTNfz7WC66opRDB vNutplol92sNKlI+mcIo1r3VU6cPX1pMu3nJ2Ob0qcUbylT6obC427itmX+/8/SozwR8 +mJYwVLKzhktN67QQ1Foe6GHjbFcFaqTbllyIO2Z1/VXc7bmG+ageErWQocpm9BkySFw rx/w== 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:mime-version :content-transfer-encoding; bh=RupCXXLKCzpPkPpwIBA0KHI28twqjq2XUeoxKKRT2GI=; b=J+Mh+1cfzJHt/51baN2Xz4f9uq4/B5eI6oS2LiPKcjfkP3JAvGscgdrKoVVQfrYO18 aNm06pPZuyFXD/wql/Yk2AXLfCqOlVgoUHOd11K9JFScwBZg30zGUMfTG9dp/slCm5FC 39GkccocC/iY34JdYV5YdKXjU7vCt+f73qvXWtM7GvrQxHilFcH99uw2tZmdqXIeO6Lm UrNfs/H+sMvBZ5YMDJGW0Pz5nahaJDVWvqbmZzoYOhw6krY/RUDhst6MVV4eR9gnLxdk zDT6U+29E+p4gyTM6idxLV1b8rKl+r2g5/2jq3GG4Kr1JnHqeV1UN0xM9G26W6/gj4BX gNgg== X-Gm-Message-State: AGi0PuYZNKV6SCq9RqNVN8fsAR8mZNLEdYHj7tK6W4tpa7PVW/KF1Oi9 8SrnXAq7svQilN3CLYFf3LWlyg+A X-Google-Smtp-Source: APiQypJ5ekvjXT804dOc53lLlFHIHQvh5CfAuTPTKd4Uhn05+8MUEaQUNEmTL9wN3nh9zE7dFbX6Mg== X-Received: by 2002:adf:8563:: with SMTP id 90mr9627345wrh.74.1589055497738; Sat, 09 May 2020 13:18:17 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1ab57.dynamic.kabel-deutschland.de. [188.193.171.87]) by smtp.gmail.com with ESMTPSA id c190sm20123900wme.10.2020.05.09.13.18.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2020 13:18:17 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 9 May 2020 22:18:10 +0200 Message-Id: <20200509201810.10532-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/mux: Remove unnecessary unreferencing of AVPacket 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" Since commit c5324d92c5f206dcdc2cf93ae237eaa7c1ad0a40 all custom interleave_packet() functions always return clean packets (even on error), so that unreferencing manually can be removed. Signed-off-by: Andreas Rheinhardt --- libavformat/mux.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libavformat/mux.c b/libavformat/mux.c index f2de73af9b..c17686c0a6 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -1075,10 +1075,7 @@ int ff_interleaved_peek(AVFormatContext *s, int stream, static int interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *in, int flush) { if (s->oformat->interleave_packet) { - int ret = s->oformat->interleave_packet(s, out, in, flush); - if (in) - av_packet_unref(in); - return ret; + return s->oformat->interleave_packet(s, out, in, flush); } else return ff_interleave_packet_per_dts(s, out, in, flush); }