diff mbox series

[FFmpeg-devel] ansi: process ESC[3m italics attribute

Message ID c40386819ca580e394a9fe0fa2c46b797fe91e64.1581988903.git.pross@xvid.org
State New
Headers show
Series [FFmpeg-devel] ansi: process ESC[3m italics attribute
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Peter Ross Feb. 18, 2020, 1:21 a.m. UTC
squelch unknown escape code warnings
---
 libavcodec/ansi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Paul B Mahol Feb. 18, 2020, 9:24 a.m. UTC | #1
lgtm

On 2/18/20, Peter Ross <pross@xvid.org> wrote:
> squelch unknown escape code warnings
> ---
>  libavcodec/ansi.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c
> index 5e1035ffd0..516d07db69 100644
> --- a/libavcodec/ansi.c
> +++ b/libavcodec/ansi.c
> @@ -34,6 +34,7 @@
>
>  #define ATTR_BOLD         0x01  /**< Bold/Bright-foreground (mode 1) */
>  #define ATTR_FAINT        0x02  /**< Faint (mode 2) */
> +#define ATTR_ITALICS      0x04  /**< Italics (mode 3) */
>  #define ATTR_UNDERLINE    0x08  /**< Underline (mode 4) */
>  #define ATTR_BLINK        0x10  /**< Blink/Bright-background (mode 5) */
>  #define ATTR_REVERSE      0x40  /**< Reverse (mode 7) */
> @@ -308,7 +309,7 @@ static int execute_code(AVCodecContext * avctx, int c)
>                  s->attributes = 0;
>                  s->fg = DEFAULT_FG_COLOR;
>                  s->bg = DEFAULT_BG_COLOR;
> -            } else if (m == 1 || m == 2 || m == 4 || m == 5 || m == 7 || m
> == 8) {
> +            } else if (m == 1 || m == 2 || m == 3 || m == 4 || m == 5 || m
> == 7 || m == 8) {
>                  s->attributes |= 1 << (m - 1);
>              } else if (m >= 30 && m <= 37) {
>                  s->fg = ansi_to_cga[m - 30];
> --
> 2.20.1
>
> -- Peter
> (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
>
diff mbox series

Patch

diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c
index 5e1035ffd0..516d07db69 100644
--- a/libavcodec/ansi.c
+++ b/libavcodec/ansi.c
@@ -34,6 +34,7 @@ 
 
 #define ATTR_BOLD         0x01  /**< Bold/Bright-foreground (mode 1) */
 #define ATTR_FAINT        0x02  /**< Faint (mode 2) */
+#define ATTR_ITALICS      0x04  /**< Italics (mode 3) */
 #define ATTR_UNDERLINE    0x08  /**< Underline (mode 4) */
 #define ATTR_BLINK        0x10  /**< Blink/Bright-background (mode 5) */
 #define ATTR_REVERSE      0x40  /**< Reverse (mode 7) */
@@ -308,7 +309,7 @@  static int execute_code(AVCodecContext * avctx, int c)
                 s->attributes = 0;
                 s->fg = DEFAULT_FG_COLOR;
                 s->bg = DEFAULT_BG_COLOR;
-            } else if (m == 1 || m == 2 || m == 4 || m == 5 || m == 7 || m == 8) {
+            } else if (m == 1 || m == 2 || m == 3 || m == 4 || m == 5 || m == 7 || m == 8) {
                 s->attributes |= 1 << (m - 1);
             } else if (m >= 30 && m <= 37) {
                 s->fg = ansi_to_cga[m - 30];