From patchwork Sun Nov 19 20:46:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stebbins X-Patchwork-Id: 6205 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp3148033jah; Sun, 19 Nov 2017 12:47:15 -0800 (PST) X-Google-Smtp-Source: AGs4zMbfSOKlp7Y0+MIFKPGmbTpjl94jCbb/Plkho5O5tC9PTcVLm9mePuXz2l3PLow3qBS20ehv X-Received: by 10.28.165.74 with SMTP id o71mr7905078wme.40.1511124435104; Sun, 19 Nov 2017 12:47:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511124435; cv=none; d=google.com; s=arc-20160816; b=OspGIqCxsG2ZtlkHQI9n6pv4uQOdzzCBF0l2LvahQPYpJ6AEgm6u1hPBreycBrGa3E X5m06waN1oAY4M8WNgWqXqd0qObLKi562ehfwQ0nCKLmcF7oz0jOtLc77YceHTX7jvLg KUJjOXQ1Oy+IlICU8HDYa8j81G8kc1xcchprOF6SXRKriGYfPLeA/6Knj5JjqDr48N4T dz4mfD9glLlzptAqxekGgNq8OWGT/RY+OYRU05uQHGccBrQ5acoZqQ9hArSPijQ/ePsE 9Jq/1tEQmeXzj6wiiEolJ+YoMw/h38Iuhim6MB4TPhcyLq+wFifiZ4ck937fN532+bJs TpcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to:arc-authentication-results; bh=cpYmBjZdgcqfBqXpooETwHLLylyVbiGTnq6HUAb6TGs=; b=rmFNcDgWJYcZ0gkK6V4aHcfeEsGxTofHVIn/jIM/kA2d4HkB3Y8uh2R86ic5lwaRZ3 8xbqxijUuj7IxTeSuP1NWh4+PTImEpRcFper5GAjxO1IYO5GV42GNIcu3dDUpdJPMRET gH8VHESHmHMu2/H4WHr2h8JHgYqIBjJ5L7VZrNz37t3WwE3x9YNW0RX8KPoBcD5+7Iah VF8IqfB0n5u0kCdhGl0xTqMpcYdfMseszmzYJRJoogYKOyo35kvyxdzvDXt3UsW/PIL8 IW/He8tsWvXCl2iATFnHUKh2MYEVd2pWUIgv8Fl5Htksq/Hc8H6HluRBbvNlhdbON6AW xNQw== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 89si6891682wra.274.2017.11.19.12.47.14; Sun, 19 Nov 2017 12:47:15 -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; 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 726C7689B3A; Sun, 19 Nov 2017 22:46:55 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.jetheaddev.com (mail.jetheaddev.com [70.164.99.34]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C87A6689257 for ; Sun, 19 Nov 2017 22:46:48 +0200 (EET) Received: from dionysus.jetheaddev.com (10.13.12.63) by cas.jetheaddev.com (192.168.13.27) with Microsoft SMTP Server (TLS) id 14.3.351.0; Sun, 19 Nov 2017 12:47:04 -0800 Received: from dionysus.jetheaddev.com (localhost [127.0.0.1]) by dionysus.jetheaddev.com (8.15.2/8.14.7) with ESMTP id vAJKl4p4004681 for ; Sun, 19 Nov 2017 12:47:04 -0800 Received: (from jstebbins@localhost) by dionysus.jetheaddev.com (8.15.2/8.15.2/Submit) id vAJKl4SH004680 for ffmpeg-devel@ffmpeg.org; Sun, 19 Nov 2017 12:47:04 -0800 From: John Stebbins To: Date: Sun, 19 Nov 2017 12:46:31 -0800 Message-ID: <20171119204635.4593-3-jstebbins@jetheaddev.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171119204635.4593-1-jstebbins@jetheaddev.com> References: <20171119204635.4593-1-jstebbins@jetheaddev.com> MIME-Version: 1.0 X-Originating-IP: [10.13.12.63] Subject: [FFmpeg-devel] [PATCH 2/6] lavc/libx264: mark disposable frames 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Used by movenc to fill sdtp box --- libavcodec/libx264.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 9c67c91f33..1831f9b30e 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -116,6 +116,7 @@ static int encode_nals(AVCodecContext *ctx, AVPacket *pkt, X264Context *x4 = ctx->priv_data; uint8_t *p; int i, size = x4->sei_size, ret; + int disposable; if (!nnal) return 0; @@ -140,10 +141,14 @@ static int encode_nals(AVCodecContext *ctx, AVPacket *pkt, av_freep(&x4->sei); } + disposable = AV_PKT_FLAG_DISPOSABLE; for (i = 0; i < nnal; i++){ memcpy(p, nals[i].p_payload, nals[i].i_payload); p += nals[i].i_payload; + if (nals[i].i_ref_idc != NAL_PRIORITY_DISPOSABLE) + disposable = 0; } + pkt->flags |= disposable; return 1; }