From patchwork Tue Feb 12 23:40:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 12055 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 72281448A56 for ; Wed, 13 Feb 2019 01:40:14 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4E7AF689E7B; Wed, 13 Feb 2019 01:40:14 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-it1-f194.google.com (mail-it1-f194.google.com [209.85.166.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7336B689B51 for ; Wed, 13 Feb 2019 01:40:07 +0200 (EET) Received: by mail-it1-f194.google.com with SMTP id y184so1277034itc.1 for ; Tue, 12 Feb 2019 15:40:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=oMiHNj1zTvBmGHnOsGW62tzbIr2FVfVPlBAs6NLEFFc=; b=ag8X/Z8n/YBzuuS7Q8tgrSh9wp9l/IPrnRyx0GurAT/bJQu76DU3vjUnlSQPDmGgox A6ncGk9qHcQnKeHEY0cspnyJJGSRjVRRBGKp69DiKyIOlKUE/THhqFxFDQQD+/q7H9w3 OL2qNEGoZ3+Qikg0qK3m5y9SrTTz+3z3NBGRqK2BsNwdHINMxVH6fOuW9Zj1IsIwMRjB 4a9XHw9yeEJkvtu/xQlgfMfRQ0MKz6AcnOtMoNUcy9m2balgkV+aAKEGg1+XwCQfXzzc gUHhq2qxozUC01Nk8224MVWTx06V/mgU1VsGv4XXNlFUzCzLDDoNnEk7ejIOdVN8X4b+ MTFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=oMiHNj1zTvBmGHnOsGW62tzbIr2FVfVPlBAs6NLEFFc=; b=hiLgiDLImrac/AXn9nhFtN9Ej6XMXv5QBLLG46mpBDmZJqjNq7lXmbmW6BrCUw93QS 5QBfFAtzecUXLEuxbfV+hJEP8IKmbofESBPitg9DpoH34uraZiwdLfOrvFTM2+OowIVg GHp/yyfJYPawmg1roJzgFNFiXzPzfvg0sjkEOZP5jwlvFWVKa9dwKhirTX0uLAzkPMo3 ziOVT8RrpS4nWz+Xsc2dz739gzJz0YK1UP6JmOtB8D3Cqml38xT082v78bBeg+CK8w2H 0pLEo+jH5mJv0hjolPT/BE1YJKgkPk9qg1ZGrvqQBryWgnCjpfpeXDp5B08+Di9Cyn9f QOYw== X-Gm-Message-State: AHQUAubCytxUtybQUlhQ/fM9EDsGehLgff6aboO1jFqA94VmMP9P9vzH kCqEEWLj0JGw7nBoJacoC/mk1xMh2sPbCI9KZisXcw== X-Google-Smtp-Source: AHgI3IY0rdWrDExdAZDn6RSZgjCNmripgca6aGG7wAqXcgk2ORG2SZ0z5h0kb/sQ6H1iGHTIIdz0VcusweMvYmRvaF4= X-Received: by 2002:a24:100d:: with SMTP id 13mr787757ity.58.1550014805684; Tue, 12 Feb 2019 15:40:05 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a02:454b:0:0:0:0:0 with HTTP; Tue, 12 Feb 2019 15:40:05 -0800 (PST) In-Reply-To: <20190212231319.10526-1-ats@offog.org> References: <20190212231319.10526-1-ats@offog.org> From: Carl Eugen Hoyos Date: Wed, 13 Feb 2019 00:40:05 +0100 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH] lavf/jacosubdec: compute subtitle duration correctly 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" 2019-02-13 0:13 GMT+01:00, Adam Sampson : > When a JACOsub subtitle has two timestamps, they represent its start and > end times (http://unicorn.us.com/jacosub/jscripts.html#l_times); the > duration is the difference between the two, not the sum of the two. > > Tested using MPV, a LaserDisc, and some authentic 1993 JACOsub files. > --- > libavformat/jacosubdec.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavformat/jacosubdec.c b/libavformat/jacosubdec.c > index 520c435cc5..f6be5df2d7 100644 > --- a/libavformat/jacosubdec.c > +++ b/libavformat/jacosubdec.c > @@ -127,7 +127,7 @@ shift_and_ret: > ts_start = (ts_start + jacosub->shift) * 100 / jacosub->timeres; > ts_end = (ts_end + jacosub->shift) * 100 / jacosub->timeres; > *start = ts_start; > - *duration = ts_start + ts_end; > + *duration = ts_end - ts_start; > return buf + len; > } > > -- > 2.20.1 Breaks fate-sub-jacosub Carl Eugen TEST sub-jacosub +Dialogue: 0,0:00:00.12,0:00:04.12,Default,,0,0,0,,{\an5}JACOsub\N\NThis script demonstrates some of the capabilities of JACOsub. +Dialogue: 0,0:00:04.12,0:00:06.62,Default,,0,0,0,,{\an8}Text may be positioned at the top, +Dialogue: 0,0:00:05.12,0:00:07.22,Default,,0,0,0,,{\an5}middle, +Dialogue: 0,0:00:06.12,0:00:07.82,Default,,0,0,0,,{\an2}or bottom of the screen. +Dialogue: 0,0:00:08.12,0:00:11.12,Default,,0,0,0,,{\an5}{this is a comment} (And, you just saw, {another comment} timing ranges for different lines of text. +Dialogue: 0,0:00:11.12,0:00:13.62,Default,,0,0,0,,{\an1}Within margin constraints\Nthat you set, text may be\Nleft justified, +Dialogue: 0,0:00:13.62,0:00:14.87,Default,,0,0,0,,{\an2}{the JC is redundant - it's the default}center\Njustified, +Dialogue: 0,0:00:14.87,0:00:16.12,Default,,0,0,0,,{\an3}and also\Nright justified. +Dialogue: 0,0:00:22.42,0:00:27.92,Default,,0,0,0,,Text may appear in different styles\N(Normal, {\b1}Bold{\r}, {\i1}Italic{\r}) +Dialogue: 0,0:01:16.12,0:01:21.12,Default,,0,0,0,,{\an5}\N\NAt that time, you may press any key to return to the Editor. +Dialogue: 0,0:01:16.12,0:01:21.12,Default,,0,0,0,,OK, this script will be finished when the screen goes blank. Test sub-jacosub failed. Look at tests/data/fate/sub-jacosub.err for details. make: *** [fate-sub-jacosub] Error 1 --- ./tests/ref/fate/sub-jacosub 2018-06-13 12:01:53.103787400 +0200 +++ tests/data/fate/sub-jacosub 2019-02-13 00:39:29.537974964 +0100 @@ -10,14 +10,14 @@ [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text -Dialogue: 0,0:00:00.12,0:00:04.36,Default,,0,0,0,,{\an5}JACOsub\N\NThis script demonstrates some of the capabilities of JACOsub. -Dialogue: 0,0:00:04.12,0:00:14.86,Default,,0,0,0,,{\an8}Text may be positioned at the top, -Dialogue: 0,0:00:05.12,0:00:17.46,Default,,0,0,0,,{\an5}middle, -Dialogue: 0,0:00:06.12,0:00:20.06,Default,,0,0,0,,{\an2}or bottom of the screen. -Dialogue: 0,0:00:08.12,0:00:27.36,Default,,0,0,0,,{\an5}{this is a comment} (And, you just saw, {another comment} timing ranges for different lines of text. -Dialogue: 0,0:00:11.12,0:00:35.86,Default,,0,0,0,,{\an1}Within margin constraints\Nthat you set, text may be\Nleft justified, -Dialogue: 0,0:00:13.62,0:00:42.11,Default,,0,0,0,,{\an2}{the JC is redundant - it's the default}center\Njustified, -Dialogue: 0,0:00:14.87,0:00:45.86,Default,,0,0,0,,{\an3}and also\Nright justified. -Dialogue: 0,0:00:22.42,0:01:12.76,Default,,0,0,0,,Text may appear in different styles\N(Normal, {\b1}Bold{\r}, {\i1}Italic{\r}) -Dialogue: 0,0:01:16.12,0:03:53.36,Default,,0,0,0,,{\an5}\N\NAt that time, you may press any key to return to the Editor. -Dialogue: 0,0:01:16.12,0:03:53.36,Default,,0,0,0,,OK, this script will be finished when the screen goes blank.