]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/movtextdec: Remove unnecessary variable
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 17 Oct 2020 17:19:35 +0000 (19:19 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 19 Oct 2020 03:08:02 +0000 (05:08 +0200)
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.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/movtextdec.c

index d46d64b6f2e886fe87bea97f5c50e8e100e9a8f7..1bfca8b79d43bee1e8012a08f5b3c3265878aa0a 100644 (file)
@@ -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)