From patchwork Sun Nov 19 21:00:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stebbins X-Patchwork-Id: 6208 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp3155570jah; Sun, 19 Nov 2017 13:01:10 -0800 (PST) X-Google-Smtp-Source: AGs4zMYuHcE3yTyRIwOF9tF0uMIah7uPudvqz0+AHBRm39KP8mvupJ/YytCLv57LEPozt8Sl6ZIg X-Received: by 10.223.179.194 with SMTP id x2mr9821373wrd.266.1511125270647; Sun, 19 Nov 2017 13:01:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511125270; cv=none; d=google.com; s=arc-20160816; b=NEup3PBeAY9uXuW2Hz91MTcNHenvPrjtiMOfJyX6h70nvtCHk9GKRnXqiEY05bzdKi X86uwPf4XCicgV0ukqFhiMItues/ZWlWdwdL6qbm1MaTzZtakYnvfh4vT3cZfNb9d9TZ 2P7ePIhWmfM251KcxH/QHDSFecxkrJYcmpIqNy4kUKnV5d1wub03R92eRdsroNT3+592 4UGXXLcAfS4XNJtySSbnRKIgW4Hti5qnILhXMezhbnvpqIaNd6G6EOmz5UXBwHz9F+YQ XFjjrQeH7Jjn+B6VQdmvUv0x4wHC5VA5V4td1gt2dm0Vg9TA7mV6/lTg7dkx+eXyAtDw V1PQ== 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=l3rzGn+ElfcfQBZWjjPFX4yO9a7U8zl0eIJhm0kzRK0=; b=pAv3oOq9WEYNmFujAa28Yyfgj03366whREfXSEOAG03qbrzCx0JsLXTWptBMbpiBBm /BNHHkPGcVAMbTW7RfhaK6OnAQOM2PY/i8vgBZ0SRght8sQwFSqhMXZkLv2Jn85R4B8Q R53FAx5KojZOca8z08X9OUAbnbni4MSHtGyB+DCmCtFxXh5oWb4LTMqdkAg3aspl2mp/ 93KFI0dfypSEECSUTd7RoGuiz/hk2Xr5db1gQhIqiWTQMCpyNb92uyqnDE5Do3odIYoH 6sPalhmb2Aed14l+h3t04CCbgF//9FvQ+30MNtR/Ir92YEW+7+F4hRFxobFl9Cf2z0NT OnMw== 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 k140si6219527wmd.38.2017.11.19.13.01.10; Sun, 19 Nov 2017 13:01:10 -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 28A17689A49; Sun, 19 Nov 2017 23:00:52 +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 6E73E689A49 for ; Sun, 19 Nov 2017 23:00:45 +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 13:01:00 -0800 Received: from dionysus.jetheaddev.com (localhost [127.0.0.1]) by dionysus.jetheaddev.com (8.15.2/8.14.7) with ESMTP id vAJL11cJ005057 for ; Sun, 19 Nov 2017 13:01:01 -0800 Received: (from jstebbins@localhost) by dionysus.jetheaddev.com (8.15.2/8.15.2/Submit) id vAJL101R005056 for ffmpeg-devel@ffmpeg.org; Sun, 19 Nov 2017 13:01:00 -0800 From: John Stebbins To: Date: Sun, 19 Nov 2017 13:00:46 -0800 Message-ID: <20171119210046.4998-2-jstebbins@jetheaddev.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171119210046.4998-1-jstebbins@jetheaddev.com> References: <20171119210046.4998-1-jstebbins@jetheaddev.com> MIME-Version: 1.0 X-Originating-IP: [10.13.12.63] Subject: [FFmpeg-devel] [PATCH 6/6] ffplay: use AV_PKT_FLAG_DISPOSABLE in frame drop logic 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" --- fftools/ffplay.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fftools/ffplay.c b/fftools/ffplay.c index 10a917194d..97555d5047 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -257,6 +257,7 @@ typedef struct VideoState { struct SwrContext *swr_ctx; int frame_drops_early; int frame_drops_late; + int drop_disposable; enum ShowMode { SHOW_MODE_NONE = -1, SHOW_MODE_VIDEO = 0, SHOW_MODE_WAVES, SHOW_MODE_RDFT, SHOW_MODE_NB @@ -1619,9 +1620,11 @@ retry: duration = vp_duration(is, vp, nextvp); if(!is->step && (framedrop>0 || (framedrop && get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER)) && time > is->frame_timer + duration){ is->frame_drops_late++; + is->drop_disposable = 1; frame_queue_next(&is->pictq); goto retry; } + is->drop_disposable = 0; } if (is->subtitle_st) { @@ -2900,6 +2903,7 @@ static int read_thread(void *arg) infinite_buffer = 1; for (;;) { + AVStream * st; if (is->abort_request) break; if (is->paused != is->last_paused) { @@ -3008,6 +3012,12 @@ static int read_thread(void *arg) } else { is->eof = 0; } + st = ic->streams[pkt->stream_index]; + if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && + is->drop_disposable && pkt->flags & AV_PKT_FLAG_DISPOSABLE) { + av_packet_unref(pkt); + continue; + } /* check if packet is in play range specified by user, then queue, otherwise discard */ stream_start_time = ic->streams[pkt->stream_index]->start_time; pkt_ts = pkt->pts == AV_NOPTS_VALUE ? pkt->dts : pkt->pts;