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 56348430DC for ; Fri, 14 Jan 2022 01:17:52 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8108868B6D2; Fri, 14 Jan 2022 03:14:09 +0200 (EET) Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5D74568B680 for ; Fri, 14 Jan 2022 03:14:01 +0200 (EET) Received: by mail-pf1-f181.google.com with SMTP id p37so1401064pfh.4 for ; Thu, 13 Jan 2022 17:14:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=kvfdnmsm1ycOUMPMsqonIN9VM28V0LuiM2jsDLNw1I8=; b=dTmG4BprhbrpR/E8MreKUoIbZwAlK5joMagURpsecDiZ4W1XOXrNwQsLWldoOhhxsi 42bqapmXcQpt8LLUCtFy4sVjD6QNhqRLaejRqdsgWdr5uLMNWBrKKp7nQ2sExVDk514f 2ejWSvUvLY4ah2m733FADMeHpLeq/j3sRum1D5PQLqteUckZY0PRJz7dAyWR8AlElAi/ JJlIyScIIU0GGZZINk2ItjnUxEVeLHRlRMqhmSF99so3rwCAEJDnJsGz3+v1xXRNoQea XFu9vB6GqyhwKgj42KIoeT4LJ0xX425tep5rB8odLCNP7h9jW1Fl9kxwPaGxcU5fDfe/ FRWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=kvfdnmsm1ycOUMPMsqonIN9VM28V0LuiM2jsDLNw1I8=; b=c6PI4ImhnyIEz0wxz3SaEjYxHEqCjhdLEajtrwvddzDAIxcxXSIo5qSq/X+JqXpQtk Ue/as6dA4aNSDoktdIJnK76hz+albmpAOlBOgl86YkDIM/pXLwVjyia1qRDWUruYHspg Wl7uodUvcudG3Piez8FHwODMjxQN8BIUFPUSxvFwv6YwKj7auvfCFfLOUWJNmanWfKwu JkB/QLeMAgzqaNfaci3heW7oQeqUCJmCxIj6RLG2vjl279HOZ1Hl7kGvJm/pUK+sehFJ 4jqWrpgFygAYBxaZN0f0z48B7AMmdr5DYA8wNYlFCDBwLYcjA5by/2MHaUOO5272EMt/ u+Hw== X-Gm-Message-State: AOAM533cawBisuC9SUNas3etDC222Fd7N7P0Ouf4Po4AGNttfs8axguv ux52kBDAbWBBPTLFJO095jbXgbsfrx5Naw== X-Google-Smtp-Source: ABdhPJzNRzYqEuzmErPEbJdw+1R6rLkCxWp2UBIMG5Jy2u/wfnpDbMbudnioXjn9QexHdaA7jEMWWg== X-Received: by 2002:a63:9d46:: with SMTP id i67mr5968187pgd.441.1642122839664; Thu, 13 Jan 2022 17:13:59 -0800 (PST) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id t6sm3229639pgk.31.2022.01.13.17.13.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jan 2022 17:13:59 -0800 (PST) Message-Id: <10c1404272f8c22fa611d1c4259a04c847cdbd18.1642122814.git.ffmpegagent@gmail.com> In-Reply-To: References: From: ffmpegagent Date: Fri, 14 Jan 2022 01:13:32 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 23/24] avcodec/webvttenc: convert hard-space tags to   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 Cc: softworkz 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: From: softworkz Signed-off-by: softworkz --- libavcodec/webvttenc.c | 6 ++++++ tests/ref/fate/sub-webvttenc | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/libavcodec/webvttenc.c b/libavcodec/webvttenc.c index c0436f5739..48945dcb8e 100644 --- a/libavcodec/webvttenc.c +++ b/libavcodec/webvttenc.c @@ -123,6 +123,11 @@ static void webvtt_new_line_cb(void *priv, int forced) webvtt_print(priv, "\n"); } +static void webvtt_hard_space_cb(void *priv) +{ + webvtt_print(priv, " "); +} + static void webvtt_style_cb(void *priv, char style, int close) { if (style == 's') // strikethrough unsupported @@ -147,6 +152,7 @@ static void webvtt_end_cb(void *priv) static const ASSCodesCallbacks webvtt_callbacks = { .text = webvtt_text_cb, .new_line = webvtt_new_line_cb, + .hard_space = webvtt_hard_space_cb, .style = webvtt_style_cb, .color = NULL, .font_name = NULL, diff --git a/tests/ref/fate/sub-webvttenc b/tests/ref/fate/sub-webvttenc index f4172dcc84..ee9de2859e 100644 --- a/tests/ref/fate/sub-webvttenc +++ b/tests/ref/fate/sub-webvttenc @@ -132,26 +132,26 @@ but show this: {normal text} \ N is a forced line break \ h is a hard space Normal spaces at the start and at the end of the line are trimmed while hard spaces are not trimmed. -The line will never break automatically right before or after a hard space. :-D +The line will never break automatically right before or after a hard space. :-D 00:54.501 --> 00:56.500 - A (05 hard spaces followed by a letter) +     A (05 hard spaces followed by a letter) A (Normal spaces followed by a letter) A (No hard spaces followed by a letter) 00:56.501 --> 00:58.500 - A (05 hard spaces followed by a letter) +     A (05 hard spaces followed by a letter) A (Normal spaces followed by a letter) A (No hard spaces followed by a letter) Show this: \TEST and this: \-) 00:58.501 --> 01:00.500 -A letter followed by 05 hard spaces: A +A letter followed by 05 hard spaces: A      A letter followed by normal spaces: A A letter followed by no hard spaces: A -05 hard spaces between letters: A A +05 hard spaces between letters: A     A 5 normal spaces between letters: A A ^--Forced line break -- ffmpeg-codebot _______________________________________________ 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".