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 D37184A588 for ; Fri, 29 Mar 2024 23:36:08 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A80F468D463; Sat, 30 Mar 2024 01:36:05 +0200 (EET) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D19E968D3D6 for ; Sat, 30 Mar 2024 01:35:58 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 00FDD40002 for ; Fri, 29 Mar 2024 23:35:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1711755358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=R2bdeXw8VPlAAltzFfHZbm1jdol4CkCeWcTa/0Zxmms=; b=H38/8EJCNGICEpdLVb1ko1wLlJdpR4PA/fyl6/dEO9PtGs8aXNE+RBZ5TLF9UYL3nLxOyX 9855Et1+ziTHhizWRChxLcEZ4ld7v9ay7guOpT9p8dgWATdgXrUN0eR1TVLBLgBv3d0XqT sUlEkAyeI2zWcxT1a41XkAlLYlLuETvTCmiSnTrcCI1Lm1Isk4eBry6cr2ChGu+PNYt958 zZbXVfDgRl1WRoSrlnV3UhItv7t1h9gAv758ZllaAAUko3/QJ5ukYFcwKFdQ2hKrVAp7qH n+JXKbLECh4qA34A7LDd7Rf9wECy2JZ/iD4zGmzzpAHAsAsUmMHFsQIWq0LUPA== Date: Sat, 30 Mar 2024 00:35:57 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240329233557.GS6420@pb2> References: <6f6d79bb1b7421e409b74e767d5dc07bf18241fe.camel@haerdin.se> <32b802fec68dea20c8744edf2e4aab80d3999f62.camel@haerdin.se> MIME-Version: 1.0 In-Reply-To: <32b802fec68dea20c8744edf2e4aab80d3999f62.camel@haerdin.se> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 2/3] lavf/srtdec: Permit streaming input 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: multipart/mixed; boundary="===============4365067666934150060==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4365067666934150060== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2CrPngV+RU+FJyRB" Content-Disposition: inline --2CrPngV+RU+FJyRB Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 28, 2024 at 11:57:57PM +0100, Tomas H=E4rdin wrote: > Here as well > libavformat/srtdec.c | 211 ++++++++++++++++++++------------= ------- > tests/ref/fate/sub-srt-rrn-remux | 4=20 > 2 files changed, 116 insertions(+), 99 deletions(-) > 699d8b957286e190de6d5ca5cd17e67bb59dab7c 0002-lavf-srtdec-Permit-streami= ng-input.patch > From 6d0684ca6fe02d80fc07a622fb85445a6917c29f Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?Tomas=3D20H=3DC3=3DA4rdin?=3D > Date: Thu, 28 Mar 2024 22:15:18 +0100 > Subject: [PATCH 2/3] lavf/srtdec: Permit streaming input >=20 > This is largely a rewrite. >=20 > Read packets in srt_read_packet() rather than reading the entire file in = srt_read_header(). > Rely on AVFMT_GENERIC_INDEX for seeking. > Allow zero-length packets (same as WebVTT). > The implementation before this is broken in at least the following ways: >=20 > Decimals like .999999 are silently accepted and converted to 999.999 seco= nds. > This is because no verification is done on the milliseconds part. > This patch enforces that the minutes and seconds parts are 00-59, and the= milliseconds 000-999. > It's not perfect since FFmpeg doesn't have regex functionality or indeed = any kind of parsing framework, > but it's better than before. >=20 > Segmenting cues by lines that consist of just a single integer is incredi= bly wrong, > since the subtitle text itself may well contain lines that are just a lon= e integer. > This means files written with CR line endings that have text with lone in= tegers are > parsed in a completely broken manner. Neither can we segment by lines con= taining --> > since this is permissible in SubRip (as far as I can tell). WebVTT explic= itly forbids it however. > --- > libavformat/srtdec.c | 211 ++++++++++++++++--------------- > tests/ref/fate/sub-srt-rrn-remux | 4 + > 2 files changed, 116 insertions(+), 99 deletions(-) breaks fate here: --- ./tests/ref/fate/sub-srt-madness-timeshift 2024-03-29 20:43:34.61741973= 1 +0100 +++ tests/data/fate/sub-srt-madness-timeshift 2024-03-30 00:30:08.776949369= +0100 @@ -3,34 +3,7 @@ okay, let's make things easy 2 -00:00:05,160 --> 00:00:05,263 -31 i'm a number but the only payload so please keep me :) - -3 00:00:06,473 --> 00:00:07,584 hello 5 -don't forget me. - -4 -00:00:08,695 --> 00:00:09,806 -no. -let's add some fun - -5 -00:00:10,917 --> 00:00:12,028 -let's do it in reverse bc wtf not -45 yes this is a number but i'm actually part of the sub - -6 -00:00:12,028 --> 00:00:13,139 -1 -0 -next is negative, not a chapnum ;) --1 - -7 -00:00:13,241 --> 00:00:13,263 -credits -2015 Test sub-srt-madness-timeshift failed. Look at tests/data/fate/sub-srt-madn= ess-timeshift.err for details. tests/Makefile:309: recipe for target 'fate-sub-srt-madness-timeshift' fail= ed make: *** [fate-sub-srt-madness-timeshift] Error 1 [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB You can kill me, but you cannot change the truth. --2CrPngV+RU+FJyRB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZgdQWgAKCRBhHseHBAsP q/SNAJ9ZQW67NPc9NDUNSgtgxtiGaeQOSwCfRH5yLppQs81LUywwzwVsdfMRiNI= =HLoz -----END PGP SIGNATURE----- --2CrPngV+RU+FJyRB-- --===============4365067666934150060== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============4365067666934150060==--