]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c
Build: move subtitles codecs to m/codec/ instead of m/codec/subtitles
[vlc] / modules / video_filter / dynamicoverlay / dynamicoverlay_commands.c
index 14630fc648eea257103b8e8ef15648230c1a2399..d119ed3290b221758e8dd12ab447eaf3c44c8a4a 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 2008 the VideoLAN team
  * $Id$
  *
- * Author: SÃ\83¸ren BÃ\83¸g <avacore@videolan.org>
+ * Author: Søren Bøg <avacore@videolan.org>
  *         Jean-Paul Saman <jpsaman@videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_arrays.h>
 #include <vlc_vout.h>
 #include <vlc_filter.h>
 
 #include <string.h>
 #include <ctype.h>
+
+#if defined(HAVE_SYS_SHM_H)
 #include <sys/shm.h>
+#endif
 
 #include "dynamicoverlay.h"
 
 
 overlay_t *OverlayCreate( void )
 {
-    overlay_t *p_ovl = malloc( sizeof( overlay_t ) );
+    overlay_t *p_ovl = calloc( 1, sizeof( overlay_t ) );
     if( p_ovl == NULL )
        return NULL;
-    memset( p_ovl, 0, sizeof( overlay_t ) );
 
     p_ovl->i_x = p_ovl->i_y = 0;
     p_ovl->i_alpha = 0xFF;
-    p_ovl->b_active = VLC_FALSE;
-    vout_InitFormat( &p_ovl->format, VLC_FOURCC( '\0','\0','\0','\0') , 0, 0,
-                     VOUT_ASPECT_FACTOR );
-    memcpy( &p_ovl->fontstyle, &default_text_style, sizeof(struct text_style_t) );
+    p_ovl->b_active = false;
+    video_format_Setup( &p_ovl->format, VLC_FOURCC( '\0','\0','\0','\0') , 0, 0,
+                        1, 1 );
+    p_ovl->p_fontstyle = text_style_New();
     p_ovl->data.p_text = NULL;
 
     return p_ovl;
@@ -63,8 +65,8 @@ overlay_t *OverlayCreate( void )
 
 int OverlayDestroy( overlay_t *p_ovl )
 {
-    if( p_ovl->data.p_text != NULL )
-        free( p_ovl->data.p_text );
+    free( p_ovl->data.p_text );
+    text_style_Delete( p_ovl->p_fontstyle );
 
     return VLC_SUCCESS;
 }
@@ -154,7 +156,7 @@ static int parser_DataSharedMem( char *psz_command,
 static int parser_Id( char *psz_command, char *psz_end,
                       commandparams_t *p_params )
 {
-    (void)(psz_end);
+    VLC_UNUSED(psz_end);
     skip_space( &psz_command );
     if( isdigit( *psz_command ) )
     {
@@ -167,16 +169,16 @@ static int parser_Id( char *psz_command, char *psz_end,
 static int parser_None( char *psz_command, char *psz_end,
                         commandparams_t *p_params )
 {
-    (void)(psz_command);
-    (void)(psz_end);
-    (void)(p_params);
+    VLC_UNUSED(psz_command);
+    VLC_UNUSED(psz_end);
+    VLC_UNUSED(p_params);
     return VLC_SUCCESS;
 }
 
 static int parser_SetAlpha( char *psz_command, char *psz_end,
                             commandparams_t *p_params )
 {
-    (void)(psz_end);
+    VLC_UNUSED(psz_end);
     skip_space( &psz_command );
     if( isdigit( *psz_command ) )
     {
@@ -195,7 +197,7 @@ static int parser_SetAlpha( char *psz_command, char *psz_end,
 static int parser_SetPosition( char *psz_command, char *psz_end,
                                commandparams_t *p_params )
 {
-    (void)(psz_end);
+    VLC_UNUSED(psz_end);
     skip_space( &psz_command );
     if( isdigit( *psz_command ) )
     {
@@ -220,7 +222,7 @@ static int parser_SetPosition( char *psz_command, char *psz_end,
 static int parser_SetTextAlpha( char *psz_command, char *psz_end,
                                 commandparams_t *p_params )
 {
-    (void)(psz_end);
+    VLC_UNUSED(psz_end);
     skip_space( &psz_command );
     if( isdigit( *psz_command ) )
     {
@@ -239,8 +241,9 @@ static int parser_SetTextAlpha( char *psz_command, char *psz_end,
 static int parser_SetTextColor( char *psz_command, char *psz_end,
                                 commandparams_t *p_params )
 {
-    int r, g, b;
-    (void)(psz_end);
+    int r = 0, g = 0, b = 0;
+    VLC_UNUSED(psz_end);
+
     skip_space( &psz_command );
     if( isdigit( *psz_command ) )
     {
@@ -265,14 +268,14 @@ static int parser_SetTextColor( char *psz_command, char *psz_end,
         if( parse_digit( &psz_command, &b ) == VLC_EGENERIC )
             return VLC_EGENERIC;
     }
-    p_params->fontstyle.i_font_color = (r<<24) | (g<<16) | (b<<8);
+    p_params->fontstyle.i_font_color = (r<<16) | (g<<8) | (b<<0);
     return VLC_SUCCESS;
 }
 
 static int parser_SetTextSize( char *psz_command, char *psz_end,
                                commandparams_t *p_params )
 {
-    (void)(psz_end);
+    VLC_UNUSED(psz_end);
     skip_space( &psz_command );
     if( isdigit( *psz_command ) )
     {
@@ -291,7 +294,7 @@ static int parser_SetTextSize( char *psz_command, char *psz_end,
 static int parser_SetVisibility( char *psz_command, char *psz_end,
                                  commandparams_t *p_params )
 {
-    (void)(psz_end);
+    VLC_UNUSED(psz_end);
     skip_space( &psz_command );
     if( isdigit( *psz_command ) )
     {
@@ -304,7 +307,7 @@ static int parser_SetVisibility( char *psz_command, char *psz_end,
         int32_t i_vis = 0;
         if( parse_digit( &psz_command, &i_vis ) == VLC_EGENERIC )
             return VLC_EGENERIC;
-        p_params->b_visible = (i_vis == 1) ? VLC_TRUE : VLC_FALSE;
+        p_params->b_visible = (i_vis == 1) ? true : false;
     }
     return VLC_SUCCESS;
 }
@@ -316,7 +319,7 @@ static int parser_SetVisibility( char *psz_command, char *psz_end,
 static int unparse_default( const commandparams_t *p_results,
                             buffer_t *p_output )
 {
-    (void)(p_results);
+    VLC_UNUSED(p_results);
     VLC_UNUSED(p_output);
     return VLC_SUCCESS;
 }
@@ -368,15 +371,15 @@ static int unparse_GetTextAlpha( const commandparams_t *p_results,
 static int unparse_GetTextColor( const commandparams_t *p_results,
                                  buffer_t *p_output )
 {
-    int ret = BufferPrintf( p_output, " %d", (p_results->fontstyle.i_font_color & 0xff0000)>>24 );
+    int ret = BufferPrintf( p_output, " %d", (p_results->fontstyle.i_font_color & 0xff0000)>>16 );
     if( ret != VLC_SUCCESS )
         return ret;
 
-    ret = BufferPrintf( p_output, " %d", (p_results->fontstyle.i_font_color & 0x00ff00)>>16 );
+    ret = BufferPrintf( p_output, " %d", (p_results->fontstyle.i_font_color & 0x00ff00)>>8 );
     if( ret != VLC_SUCCESS )
         return ret;
 
-    ret = BufferPrintf( p_output, " %d", (p_results->fontstyle.i_font_color & 0x0000ff)>>8 );
+    ret = BufferPrintf( p_output, " %d", (p_results->fontstyle.i_font_color & 0x0000ff) );
     if( ret != VLC_SUCCESS )
         return ret;
 
@@ -410,12 +413,13 @@ static int exec_DataSharedMem( filter_t *p_filter,
                                const commandparams_t *p_params,
                                commandparams_t *p_results )
 {
+#if defined(HAVE_SYS_SHM_H)
     filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
     struct shmid_ds shminfo;
     overlay_t *p_ovl;
     size_t i_size;
 
-    (void)(p_results);
+    VLC_UNUSED(p_results);
 
     p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
     if( p_ovl == NULL )
@@ -431,14 +435,14 @@ static int exec_DataSharedMem( filter_t *p_filter,
     }
     i_size = shminfo.shm_segsz;
 
-    if( p_params->fourcc == VLC_FOURCC('T','E','X','T') )
+    if( p_params->fourcc == VLC_CODEC_TEXT )
     {
         char *p_data;
 
         if( (p_params->i_height != 1) || (p_params->i_width < 1) )
         {
             msg_Err( p_filter,
-                     "Invalid width and/or height. when specifing text height "
+                     "Invalid width and/or height. when specifying text height "
                      "must be 1 and width the number of bytes in the string, "
                      "including the null terminator" );
             return VLC_EGENERIC;
@@ -447,7 +451,7 @@ static int exec_DataSharedMem( filter_t *p_filter,
         if( (size_t)p_params->i_width > i_size )
         {
             msg_Err( p_filter,
-                     "Insufficient data in shared memory. need %d, got %d",
+                     "Insufficient data in shared memory. need %d, got %zu",
                      p_params->i_width, i_size );
             return VLC_EGENERIC;
         }
@@ -459,8 +463,8 @@ static int exec_DataSharedMem( filter_t *p_filter,
             return VLC_ENOMEM;
         }
 
-        vout_InitFormat( &p_ovl->format, VLC_FOURCC('T','E','X','T'),
-                         0, 0, 0 );
+        video_format_Setup( &p_ovl->format, VLC_CODEC_TEXT,
+                            0, 0, 0, 1 );
 
         p_data = shmat( p_params->i_shmid, NULL, SHM_RDONLY );
         if( p_data == NULL )
@@ -470,7 +474,6 @@ static int exec_DataSharedMem( filter_t *p_filter,
             p_ovl->data.p_text = NULL;
             return VLC_ENOMEM;
         }
-
         memcpy( p_ovl->data.p_text, p_data, p_params->i_width );
 
         shmdt( p_data );
@@ -480,25 +483,13 @@ static int exec_DataSharedMem( filter_t *p_filter,
         uint8_t *p_data, *p_in;
         size_t i_neededsize = 0;
 
-        p_ovl->data.p_pic = malloc( sizeof( picture_t ) );
+        p_ovl->data.p_pic = picture_New( p_params->fourcc,
+                                         p_params->i_width, p_params->i_height,
+                                         1, 1 );
         if( p_ovl->data.p_pic == NULL )
-        {
-            msg_Err( p_filter, "Unable to allocate picture structure" );
             return VLC_ENOMEM;
-        }
 
-        vout_InitFormat( &p_ovl->format, p_params->fourcc,
-                         p_params->i_width, p_params->i_height,
-                         VOUT_ASPECT_FACTOR );
-        if( vout_AllocatePicture( p_filter, p_ovl->data.p_pic,
-                                  p_ovl->format.i_chroma, p_params->i_width,
-                                  p_params->i_height, p_ovl->format.i_aspect ) )
-        {
-            msg_Err( p_filter, "Unable to allocate picture" );
-            free( p_ovl->data.p_pic );
-            p_ovl->data.p_pic = NULL;
-            return VLC_ENOMEM;
-        }
+        p_ovl->format = p_ovl->data.p_pic->format;
 
         for( size_t i_plane = 0; i_plane < (size_t)p_ovl->data.p_pic->i_planes;
              ++i_plane )
@@ -510,10 +501,9 @@ static int exec_DataSharedMem( filter_t *p_filter,
         if( i_neededsize > i_size )
         {
             msg_Err( p_filter,
-                     "Insufficient data in shared memory. need %d, got %d",
+                     "Insufficient data in shared memory. need %zu, got %zu",
                      i_neededsize, i_size );
-            p_ovl->data.p_pic->pf_release( p_ovl->data.p_pic );
-            free( p_ovl->data.p_pic );
+            picture_Release( p_ovl->data.p_pic );
             p_ovl->data.p_pic = NULL;
             return VLC_EGENERIC;
         }
@@ -522,8 +512,7 @@ static int exec_DataSharedMem( filter_t *p_filter,
         if( p_data == NULL )
         {
             msg_Err( p_filter, "Unable to attach to shared memory" );
-            p_ovl->data.p_pic->pf_release( p_ovl->data.p_pic );
-            free( p_ovl->data.p_pic );
+            picture_Release( p_ovl->data.p_pic );
             p_ovl->data.p_pic = NULL;
             return VLC_ENOMEM;
         }
@@ -537,27 +526,33 @@ static int exec_DataSharedMem( filter_t *p_filter,
                  i_line < (size_t)p_ovl->data.p_pic->p[i_plane].i_visible_lines;
                  ++i_line )
             {
-                p_filter->p_libvlc->pf_memcpy( p_out, p_in,
-                                p_ovl->data.p_pic->p[i_plane].i_visible_pitch );
+                vlc_memcpy( p_out, p_in,
+                            p_ovl->data.p_pic->p[i_plane].i_visible_pitch );
                 p_out += p_ovl->data.p_pic->p[i_plane].i_pitch;
                 p_in += p_ovl->data.p_pic->p[i_plane].i_visible_pitch;
             }
         }
         shmdt( p_data );
     }
-
     p_sys->b_updated = p_ovl->b_active;
 
     return VLC_SUCCESS;
+#else
+    VLC_UNUSED(p_params);
+    VLC_UNUSED(p_results);
+
+    msg_Err( p_filter, "system doesn't support shared memory" );
+    return VLC_EGENERIC;
+#endif
 }
 
 static int exec_DeleteImage( filter_t *p_filter,
                              const commandparams_t *p_params,
                              commandparams_t *p_results )
 {
-    (void)(p_results);
+    VLC_UNUSED(p_results);
     filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
-    p_sys->b_updated = VLC_TRUE;
+    p_sys->b_updated = true;
 
     return ListRemove( &p_sys->overlays, p_params->i_id );
 }
@@ -566,11 +561,11 @@ static int exec_EndAtomic( filter_t *p_filter,
                            const commandparams_t *p_params,
                            commandparams_t *p_results )
 {
-    (void)(p_params);
-    (void)(p_results);
+    VLC_UNUSED(p_params);
+    VLC_UNUSED(p_results);
     filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
     QueueTransfer( &p_sys->pending, &p_sys->atomic );
-    p_sys->b_atomic = VLC_FALSE;
+    p_sys->b_atomic = false;
     return VLC_SUCCESS;
 }
 
@@ -578,7 +573,7 @@ static int exec_GenImage( filter_t *p_filter,
                           const commandparams_t *p_params,
                           commandparams_t *p_results )
 {
-    (void)(p_params);
+    VLC_UNUSED(p_params);
     filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
 
     overlay_t *p_ovl = OverlayCreate();
@@ -629,7 +624,7 @@ static int exec_GetTextAlpha( filter_t *p_filter,
     if( p_ovl == NULL )
         return VLC_EGENERIC;
 
-    p_results->fontstyle.i_font_alpha = p_ovl->fontstyle.i_font_alpha;
+    p_results->fontstyle.i_font_alpha = p_ovl->p_fontstyle->i_font_alpha;
     return VLC_SUCCESS;
 }
 
@@ -642,7 +637,7 @@ static int exec_GetTextColor( filter_t *p_filter,
     if( p_ovl == NULL )
         return VLC_EGENERIC;
 
-    p_results->fontstyle.i_font_color = p_ovl->fontstyle.i_font_color;
+    p_results->fontstyle.i_font_color = p_ovl->p_fontstyle->i_font_color;
     return VLC_SUCCESS;
 }
 
@@ -655,7 +650,7 @@ static int exec_GetTextSize( filter_t *p_filter,
     if( p_ovl == NULL )
         return VLC_EGENERIC;
 
-    p_results->fontstyle.i_font_size = p_ovl->fontstyle.i_font_size;
+    p_results->fontstyle.i_font_size = p_ovl->p_fontstyle->i_font_size;
     return VLC_SUCCESS;
 }
 
@@ -669,7 +664,7 @@ static int exec_GetVisibility( filter_t *p_filter,
     if( p_ovl == NULL )
         return VLC_EGENERIC;
 
-    p_results->b_visible = ( p_ovl->b_active == VLC_TRUE ) ? 1 : 0;
+    p_results->b_visible = ( p_ovl->b_active == true ) ? 1 : 0;
     return VLC_SUCCESS;
 }
 
@@ -677,7 +672,7 @@ static int exec_SetAlpha( filter_t *p_filter,
                           const commandparams_t *p_params,
                           commandparams_t *p_results )
 {
-    (void)(p_results);
+    VLC_UNUSED(p_results);
     filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
 
     overlay_t *p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
@@ -693,7 +688,7 @@ static int exec_SetPosition( filter_t *p_filter,
                              const commandparams_t *p_params,
                              commandparams_t *p_results )
 {
-    (void)(p_results);
+    VLC_UNUSED(p_results);
     filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
 
     overlay_t *p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
@@ -711,14 +706,14 @@ static int exec_SetTextAlpha( filter_t *p_filter,
                               const commandparams_t *p_params,
                               commandparams_t *p_results )
 {
-    (void)(p_results);
+    VLC_UNUSED(p_results);
     filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
 
     overlay_t *p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
     if( p_ovl == NULL )
         return VLC_EGENERIC;
 
-    p_ovl->fontstyle.i_font_alpha = p_params->fontstyle.i_font_alpha;
+    p_ovl->p_fontstyle->i_font_alpha = p_params->fontstyle.i_font_alpha;
     p_sys->b_updated = p_ovl->b_active;
     return VLC_SUCCESS;
 }
@@ -727,14 +722,14 @@ static int exec_SetTextColor( filter_t *p_filter,
                               const commandparams_t *p_params,
                               commandparams_t *p_results )
 {
-    (void)(p_results);
+    VLC_UNUSED(p_results);
     filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
 
     overlay_t *p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
     if( p_ovl == NULL )
         return VLC_EGENERIC;
 
-    p_ovl->fontstyle.i_font_color = p_params->fontstyle.i_font_color;
+    p_ovl->p_fontstyle->i_font_color = p_params->fontstyle.i_font_color;
     p_sys->b_updated = p_ovl->b_active;
     return VLC_SUCCESS;
 }
@@ -743,14 +738,14 @@ static int exec_SetTextSize( filter_t *p_filter,
                               const commandparams_t *p_params,
                               commandparams_t *p_results )
 {
-    (void)(p_results);
+    VLC_UNUSED(p_results);
     filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
 
     overlay_t *p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
     if( p_ovl == NULL )
         return VLC_EGENERIC;
 
-    p_ovl->fontstyle.i_font_size = p_params->fontstyle.i_font_size;
+    p_ovl->p_fontstyle->i_font_size = p_params->fontstyle.i_font_size;
     p_sys->b_updated = p_ovl->b_active;
     return VLC_SUCCESS;
 }
@@ -759,15 +754,15 @@ static int exec_SetVisibility( filter_t *p_filter,
                                const commandparams_t *p_params,
                                commandparams_t *p_results )
 {
-    (void)(p_results);
+    VLC_UNUSED(p_results);
     filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
 
     overlay_t *p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
     if( p_ovl == NULL )
         return VLC_EGENERIC;
 
-    p_ovl->b_active = p_params->b_visible;// ? VLC_FALSE : VLC_TRUE;
-    p_sys->b_updated = VLC_TRUE;
+    p_ovl->b_active = p_params->b_visible;// ? false : true;
+    p_sys->b_updated = true;
     return VLC_SUCCESS;
 }
 
@@ -776,116 +771,116 @@ static int exec_StartAtomic( filter_t *p_filter,
                              commandparams_t *p_results )
 {
     filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
-    (void)(p_params);
-    (void)(p_results);
+    VLC_UNUSED(p_params);
+    VLC_UNUSED(p_results);
 
-    p_sys->b_atomic = VLC_TRUE;
+    p_sys->b_atomic = true;
     return VLC_SUCCESS;
 }
 
 /*****************************************************************************
  * Command functions
  *****************************************************************************/
-static commanddesc_t p_commands[] =
+static const commanddesc_static_t p_commands[] =
 {
     {   .psz_command = "DataSharedMem",
-        .b_atomic = VLC_TRUE,
+        .b_atomic = true,
         .pf_parser = parser_DataSharedMem,
         .pf_execute = exec_DataSharedMem,
         .pf_unparse = unparse_default,
     },
     {   .psz_command = "DeleteImage",
-        .b_atomic = VLC_TRUE,
+        .b_atomic = true,
         .pf_parser = parser_Id,
         .pf_execute = exec_DeleteImage,
         .pf_unparse = unparse_default,
     },
     {   .psz_command = "EndAtomic",
-        .b_atomic = VLC_FALSE,
+        .b_atomic = false,
         .pf_parser = parser_None,
         .pf_execute = exec_EndAtomic,
         .pf_unparse = unparse_default,
     },
     {   .psz_command = "GenImage",
-        .b_atomic = VLC_FALSE,
+        .b_atomic = false,
         .pf_parser = parser_None,
         .pf_execute = exec_GenImage,
         .pf_unparse = unparse_GenImage,
     },
     {   .psz_command = "GetAlpha",
-        .b_atomic = VLC_FALSE,
+        .b_atomic = false,
         .pf_parser = parser_Id,
         .pf_execute = exec_GetAlpha,
         .pf_unparse = unparse_GetAlpha,
     },
     {   .psz_command = "GetPosition",
-        .b_atomic = VLC_FALSE,
+        .b_atomic = false,
         .pf_parser = parser_Id,
         .pf_execute = exec_GetPosition,
         .pf_unparse = unparse_GetPosition,
     },
     {   .psz_command = "GetTextAlpha",
-        .b_atomic = VLC_FALSE,
+        .b_atomic = false,
         .pf_parser = parser_Id,
         .pf_execute = exec_GetTextAlpha,
         .pf_unparse = unparse_GetTextAlpha,
     },
     {   .psz_command = "GetTextColor",
-        .b_atomic = VLC_FALSE,
+        .b_atomic = false,
         .pf_parser = parser_Id,
         .pf_execute = exec_GetTextColor,
         .pf_unparse = unparse_GetTextColor,
     },
     {   .psz_command = "GetTextSize",
-        .b_atomic = VLC_TRUE,
+        .b_atomic = true,
         .pf_parser = parser_Id,
         .pf_execute = exec_GetTextSize,
         .pf_unparse = unparse_GetTextSize,
     },
     {   .psz_command = "GetVisibility",
-        .b_atomic = VLC_FALSE,
+        .b_atomic = false,
         .pf_parser = parser_Id,
         .pf_execute = exec_GetVisibility,
         .pf_unparse = unparse_GetVisibility,
     },
     {   .psz_command = "SetAlpha",
-        .b_atomic = VLC_TRUE,
+        .b_atomic = true,
         .pf_parser = parser_SetAlpha,
         .pf_execute = exec_SetAlpha,
         .pf_unparse = unparse_default,
     },
     {   .psz_command = "SetPosition",
-        .b_atomic = VLC_TRUE,
+        .b_atomic = true,
         .pf_parser = parser_SetPosition,
         .pf_execute = exec_SetPosition,
         .pf_unparse = unparse_default,
     },
     {   .psz_command = "SetTextAlpha",
-        .b_atomic = VLC_TRUE,
+        .b_atomic = true,
         .pf_parser = parser_SetTextAlpha,
         .pf_execute = exec_SetTextAlpha,
         .pf_unparse = unparse_default,
     },
     {   .psz_command = "SetTextColor",
-        .b_atomic = VLC_TRUE,
+        .b_atomic = true,
         .pf_parser = parser_SetTextColor,
         .pf_execute = exec_SetTextColor,
         .pf_unparse = unparse_default,
     },
     {   .psz_command = "SetTextSize",
-        .b_atomic = VLC_TRUE,
+        .b_atomic = true,
         .pf_parser = parser_SetTextSize,
         .pf_execute = exec_SetTextSize,
         .pf_unparse = unparse_default,
     },
     {   .psz_command = "SetVisibility",
-        .b_atomic = VLC_TRUE,
+        .b_atomic = true,
         .pf_parser = parser_SetVisibility,
         .pf_execute = exec_SetVisibility,
         .pf_unparse = unparse_default,
     },
     {   .psz_command = "StartAtomic",
-        .b_atomic = VLC_TRUE,
+        .b_atomic = true,
         .pf_parser = parser_None,
         .pf_execute = exec_StartAtomic,
         .pf_unparse = unparse_default,
@@ -911,7 +906,7 @@ void RegisterCommand( filter_t *p_filter )
         p_sys->pp_commands[i_index]->pf_unparse = p_commands[i_index].pf_unparse;
     }
 
-    msg_Dbg( p_filter, "%d commands are available", p_sys->i_commands );
+    msg_Dbg( p_filter, "%zu commands are available", p_sys->i_commands );
     for( size_t i_index = 0; i_index < p_sys->i_commands; i_index++ )
         msg_Dbg( p_filter, "    %s", p_sys->pp_commands[i_index]->psz_command );
 }