From patchwork Sun Nov 15 09:00:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lhomme X-Patchwork-Id: 23646 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 A9B3544AB38 for ; Sun, 15 Nov 2020 11:00:24 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8A09668B9E0; Sun, 15 Nov 2020 11:00:24 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3707D68B9E2 for ; Sun, 15 Nov 2020 11:00:18 +0200 (EET) Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4CYmPY5mvkzQl8h for ; Sun, 15 Nov 2020 10:00:17 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id 2oPtLlH8D0N4 for ; Sun, 15 Nov 2020 10:00:14 +0100 (CET) From: Steve Lhomme To: ffmpeg-devel@ffmpeg.org Date: Sun, 15 Nov 2020 10:00:12 +0100 Message-Id: <20201115090012.26055-1-robux4@ycbcr.xyz> MIME-Version: 1.0 X-MBO-SPAM-Probability: * X-Rspamd-Score: 0.13 / 15.00 / 15.00 X-Rspamd-Queue-Id: DCFEE1825 X-Rspamd-UID: 231b21 Subject: [FFmpeg-devel] [PATCH] avformat/matroskadec: update the end timestamp when there is a timestamp 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" No need to check if the cluster has a timestamp or not. If we found a timestamp for this block, then it's usable. This is actually the same condition to decide if we can use the timestamp or not. --- libavformat/matroskadec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 137674c068..8a5bc4018a 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -3626,7 +3626,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, AVBufferRef *buf if (!block_duration && trust_default_duration) block_duration = track->default_duration * laces / matroska->time_scale; - if (cluster_time != (uint64_t)-1 && (block_time >= 0 || cluster_time >= -block_time)) + if (timecode != AV_NOPTS_VALUE) track->end_timecode = FFMAX(track->end_timecode, timecode + block_duration);