From patchwork Sat Oct 17 18:22:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23048 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 779AD44B29E for ; Sat, 17 Oct 2020 21:23:30 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 62A5B68BB5B; Sat, 17 Oct 2020 21:23:30 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DC53D68BAA0 for ; Sat, 17 Oct 2020 21:23:21 +0300 (EEST) Received: by mail-wm1-f68.google.com with SMTP id f21so6500093wml.3 for ; Sat, 17 Oct 2020 11:23:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qWjGB3K4tZtPsFaQdo0C3hATnY2naBh4AbAHSQObzzA=; b=S0E6lek96jqLI/sitNUQnIWT4sH/E1Ho8l67Ks5LJYTf1Gc6v7oDfIVFq2DJcBda3x 4yQRxvXmm7y26ifO2Z/NAW9Q5wkfQ3uLzhIf6TKOmmtJ6k79krIMZ+6dAU9XndNSzuhW Qfdaa5N3y5Q0zbTydgmQht6kQHqG2PjYQmWHegyjhTX5xRhwr025qIJjhZ1PL4+DV034 J6h0fTr48mRYsZmtw+OJK6hLv+NdeTIus2GM5vjbzg06Zy1pXLSl4dSS0iM42rkUJVDC ol+AuzXGn5Lpnv2epCic3bcigrAkzCfqT1ZnqOub9BzgBzg2aR1RosivOBBS3rSA9G+s WBbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qWjGB3K4tZtPsFaQdo0C3hATnY2naBh4AbAHSQObzzA=; b=lkzyDIMK9Ddg4mTRTLsxGjM3ooycSJ8jKsRmma53C0vP6OsotGRyLlwTvTSyeatjxj dlqbrG3DsLZSfUaKPclJQW16RUtvsNrxsuo8Sy3zcF0xgvyY2/2s8AkKYb5gMVB17g3g eLrn7/BsIUt7mkIxo+O2repSpJyxxOA7aJEl6d2hDOcCSa6daMzEyN6eo7meVT5iDp2p virj3KSue5jXrJ4h0K3B4dmizvlpB5YlA5U4oY0xEfD5lBE4+GvOoF0PIcuXVlwCsf+6 QzpKFW939n8VoKqlEUO8v+oSAojCDTjHjdcfU81xPZvG1FXSsUlrQV++4c2qjv01FPMH 800A== X-Gm-Message-State: AOAM533hvmk9CHtTLpCRQKjzDpxOBUsFrGee2OCo2tqlRyZvs34wPYrQ Ehn95Ic69t5cm9bMgyjcWsMmgSHB/zE= X-Google-Smtp-Source: ABdhPJzzl0fezxqulRaP0szOTpUKDO8jwbIwg2qTEYeBh7T6C8OXI5hwkylhExOOGKbbrWVwE+SF2w== X-Received: by 2002:a1c:dc43:: with SMTP id t64mr9802222wmg.6.1602959001225; Sat, 17 Oct 2020 11:23:21 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id d20sm10440688wra.38.2020.10.17.11.23.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 11:23:20 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 17 Oct 2020 20:22:45 +0200 Message-Id: <20201017182248.577108-8-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201017182248.577108-1-andreas.rheinhardt@gmail.com> References: <20201017182248.577108-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 08/11] avcodec/movtextdec: Remove unnecessary variable 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" style_active doesn't do anything any more: It is already assured that style_active is one when one reaches the end of a style. Signed-off-by: Andreas Rheinhardt --- libavcodec/movtextdec.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c index d46d64b6f2..1bfca8b79d 100644 --- a/libavcodec/movtextdec.c +++ b/libavcodec/movtextdec.c @@ -356,7 +356,6 @@ static int text_to_ass(AVBPrint *buf, const char *text, const char *text_end, MovTextContext *m = avctx->priv_data; int i = 0; int text_pos = 0; - int style_active = 0; int entry = 0; int color = m->d.color; @@ -374,16 +373,12 @@ static int text_to_ass(AVBPrint *buf, const char *text, const char *text_end, if ((m->box_flags & STYL_BOX) && entry < m->style_entries) { const StyleBox *style = &m->s[entry]; if (text_pos == style->style_end) { - if (style_active) { - av_bprintf(buf, "{\\r}"); - style_active = 0; - color = m->d.color; - } + av_bprintf(buf, "{\\r}"); + color = m->d.color; entry++; style++; } if (entry < m->style_entries && text_pos == style->style_start) { - style_active = 1; if (style->bold ^ m->d.bold) av_bprintf(buf, "{\\b%d}", style->bold); if (style->italic ^ m->d.italic)