From patchwork Wed Jun 5 14:28:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyan Doshi X-Patchwork-Id: 13419 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 4CC7C4464B3 for ; Wed, 5 Jun 2019 17:28:50 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2EF0A689F1A; Wed, 5 Jun 2019 17:28:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mx2.mailbox.org (mx2.mailbox.org [80.241.60.215]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 57BA2689CFB for ; Wed, 5 Jun 2019 17:28:44 +0300 (EEST) Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id B41C5A0149 for ; Wed, 5 Jun 2019 16:28:43 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id Yr2egxc0Ldsz for ; Wed, 5 Jun 2019 16:28:31 +0200 (CEST) To: FFmpeg development discussions and patches From: Gyan Message-ID: <8ee9ddce-e13f-bb31-2884-c050b2ebdf74@gyani.pro> Date: Wed, 5 Jun 2019 19:58:27 +0530 MIME-Version: 1.0 Content-Language: en-US Subject: [FFmpeg-devel] [PATCH] avfilter/framesync: fix shortest with eof_action=pass 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" With current order, shortest gets ignored with eof_action=pass Gyan From 61834c8a9d8b01c2a82a001d2974d6389f7f7c49 Mon Sep 17 00:00:00 2001 From: Gyan Doshi Date: Wed, 5 Jun 2019 19:52:04 +0530 Subject: [PATCH] avfilter/framesync: fix shortest with eof_action=pass Shifted check of shortest to after repeatlast, to ensure shortest=1 is always honoured. --- libavfilter/framesync.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavfilter/framesync.c b/libavfilter/framesync.c index 22d3f091a3..bc95f7d904 100644 --- a/libavfilter/framesync.c +++ b/libavfilter/framesync.c @@ -127,16 +127,16 @@ int ff_framesync_configure(FFFrameSync *fs) fs->opt_shortest = 1; fs->opt_eof_action = EOF_ACTION_ENDALL; } - if (fs->opt_shortest) { - for (i = 0; i < fs->nb_in; i++) - fs->in[i].after = EXT_STOP; - } if (!fs->opt_repeatlast) { for (i = 1; i < fs->nb_in; i++) { fs->in[i].after = EXT_NULL; fs->in[i].sync = 0; } } + if (fs->opt_shortest) { + for (i = 0; i < fs->nb_in; i++) + fs->in[i].after = EXT_STOP; + } if (!fs->time_base.num) { for (i = 0; i < fs->nb_in; i++) {