From patchwork Tue Oct 18 16:33:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 1056 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.133 with SMTP id o127csp759340vsd; Tue, 18 Oct 2016 09:34:17 -0700 (PDT) X-Received: by 10.28.67.6 with SMTP id q6mr11950875wma.43.1476808457452; Tue, 18 Oct 2016 09:34:17 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id z1si15883575wjk.104.2016.10.18.09.34.17; Tue, 18 Oct 2016 09:34:17 -0700 (PDT) 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 348B8689B12; Tue, 18 Oct 2016 19:34:13 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe03-1.mx.upcmail.net (vie01a-dmta-pe03-1.mx.upcmail.net [62.179.121.160]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4306868980E for ; Tue, 18 Oct 2016 19:34:07 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe03.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1bwXL7-0002He-38 for ffmpeg-devel@ffmpeg.org; Tue, 18 Oct 2016 18:34:09 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id x4a71t00z0S5wYM014a8Yo; Tue, 18 Oct 2016 18:34:09 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 18 Oct 2016 18:33:59 +0200 Message-Id: <20161018163359.25106-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.10.1 Subject: [FFmpeg-devel] [PATCH] avformat/movenc: Skip duration check for discontinuous fragments 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Found-by: Daemon404 Signed-off-by: Michael Niedermayer --- libavformat/movenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index d7c7158..50be8ff 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -4697,7 +4697,8 @@ static int check_pkt(AVFormatContext *s, AVPacket *pkt) if (trk->entry) { ref = trk->cluster[trk->entry - 1].dts; - } else if (trk->start_dts != AV_NOPTS_VALUE) { + } else if ( trk->start_dts != AV_NOPTS_VALUE + && !trk->frag_discont) { ref = trk->start_dts + trk->track_duration; } else ref = pkt->dts; // Skip tests for the first packet