From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id D333D40C81 for ; Wed, 29 Dec 2021 19:59:07 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EE0A368A538; Wed, 29 Dec 2021 21:59:05 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CE30A68041C for ; Wed, 29 Dec 2021 21:58:59 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 6B2BE24017C for ; Wed, 29 Dec 2021 20:58:59 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id kGEb7UayHeaT for ; Wed, 29 Dec 2021 20:58:59 +0100 (CET) Received: from lain.red.khirnov.net (lain.red.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.red.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id EFEF0240179 for ; Wed, 29 Dec 2021 20:58:58 +0100 (CET) Received: by lain.red.khirnov.net (Postfix, from userid 1000) id 0863716008E; Wed, 29 Dec 2021 20:58:58 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <20211228164347.632-1-ffmpeg@gyani.pro> References: <20211228164347.632-1-ffmpeg@gyani.pro> Mail-Followup-To: FFmpeg development discussions and patches Date: Wed, 29 Dec 2021 20:58:58 +0100 Message-ID: <164080793892.2375.10866992245959660439@lain.red.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH v2] avformat/mov: adjust 0 values in stts X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Quoting Gyan Doshi (2021-12-28 17:43:47) > As per ISO 14496-12, sample duration of 0 is invalid except for > the last entry. However, some files may use it to stall dts > progress in order to recover from a desync. > > In addition, catch and fix 0 value for sample count. > --- > v2: > > adjust dts if 0 duration is encountered > > libavformat/mov.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/libavformat/mov.c b/libavformat/mov.c > index 351ecde770..7e90e24bd5 100644 > --- a/libavformat/mov.c > +++ b/libavformat/mov.c > @@ -2970,16 +2970,22 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom) > av_log(c->fc, AV_LOG_TRACE, "sample_count=%u, sample_duration=%u\n", > sample_count, sample_duration); > > + if (!sample_count) { > + av_log(c->fc, AV_LOG_WARNING, "invalid sample count of 0 in stts for st %d at entry %u; changing to 1.\n", > + c->fc->nb_streams-1, i); > + sc->stts_data[i].count = sample_count = 1; broken indentation Also would be very nice to have a test for this. -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".