]> git.sesse.net Git - vlc/blobdiff - modules/gui/ncurses.c
skins2: fix video autoresize default when contradictory
[vlc] / modules / gui / ncurses.c
index 2eaf95f02c204a6fc2437fa43fbb4c9c38c00f6d..e1f190a3f503a6562d79d8d8ae4b0517c3f05797 100644 (file)
@@ -1472,7 +1472,7 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
     memset( psz_title, ' ', mid );
     if( p_sys->b_color )
         wcolor_set( p_sys->w, C_TITLE, NULL );
-    snprintf( &psz_title[mid], i_size, "VLC media player "PACKAGE_VERSION );
+    strlcpy( &psz_title[mid], "VLC media player "PACKAGE_VERSION, i_size );
     mvnprintw( y, 0, COLS, "%s", psz_title );
     attroff( A_REVERSE );
     y += 2;
@@ -1536,7 +1536,8 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
             {
                 int i_title_count = var_CountChoices( p_input, "title" );
                 if( i_title_count > 0 )
-                    mvnprintw( y++, 0, COLS, _(" Title    : %d/%d"), val.i_int, i_title_count );
+                    mvnprintw( y++, 0, COLS, _(" Title    : %"PRId64"/%d"),
+                               val.i_int, i_title_count );
             }
 
             /* Chapter */
@@ -1544,7 +1545,8 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
             {
                 int i_chapter_count = var_CountChoices( p_input, "chapter" );
                 if( i_chapter_count > 0 )
-                    mvnprintw( y++, 0, COLS, _(" Chapter  : %d/%d"), val.i_int, i_chapter_count );
+                    mvnprintw( y++, 0, COLS, _(" Chapter  : %"PRId64"/%d"),
+                               val.i_int, i_chapter_count );
             }
         }
         else
@@ -1745,7 +1747,7 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
             for( i=0; i<VLC_META_TYPE_COUNT; i++ )
             {
                 if( y >= y_end ) break;
-                char *psz_meta = vlc_meta_Get( p_item->p_meta, i );
+                const char *psz_meta = vlc_meta_Get( p_item->p_meta, i );
                 if( psz_meta && *psz_meta )
                 {
                     const char *psz_meta_title;
@@ -1972,13 +1974,13 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
             MainBoxWrite( p_intf, l, 1, _("+-[Incoming]"));
             SHOW_ACS( 1, ACS_ULCORNER );  SHOW_ACS( 2, ACS_HLINE ); l++;
             if( p_sys->b_color ) wcolor_set( p_sys->w, C_DEFAULT, NULL );
-            MainBoxWrite( p_intf, l, 1, _("| input bytes read : %8.0f kB"),
-                    (float)(p_item->p_stats->i_read_bytes)/1000 );
+            MainBoxWrite( p_intf, l, 1, _("| input bytes read : %8.0f KiB"),
+                    (float)(p_item->p_stats->i_read_bytes)/1024 );
             SHOW_ACS( 1, ACS_VLINE ); l++;
             MainBoxWrite( p_intf, l, 1, _("| input bitrate    :   %6.0f kb/s"),
                     (float)(p_item->p_stats->f_input_bitrate)*8000 );
-            MainBoxWrite( p_intf, l, 1, _("| demux bytes read : %8.0f kB"),
-                    (float)(p_item->p_stats->i_demux_read_bytes)/1000 );
+            MainBoxWrite( p_intf, l, 1, _("| demux bytes read : %8.0f KiB"),
+                    (float)(p_item->p_stats->i_demux_read_bytes)/1024 );
             SHOW_ACS( 1, ACS_VLINE ); l++;
             MainBoxWrite( p_intf, l, 1, _("| demux bitrate    :   %6.0f kb/s"),
                     (float)(p_item->p_stats->f_demux_bitrate)*8000 );
@@ -1993,13 +1995,13 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
                 MainBoxWrite( p_intf, l, 1, _("+-[Video Decoding]"));
                 SHOW_ACS( 1, ACS_LTEE );  SHOW_ACS( 2, ACS_HLINE ); l++;
                 if( p_sys->b_color ) wcolor_set( p_sys->w, C_DEFAULT, NULL );
-                MainBoxWrite( p_intf, l, 1, _("| video decoded    :    %5i"),
+                MainBoxWrite( p_intf, l, 1, _("| video decoded    :    %"PRId64),
                         p_item->p_stats->i_decoded_video );
                 SHOW_ACS( 1, ACS_VLINE ); l++;
-                MainBoxWrite( p_intf, l, 1, _("| frames displayed :    %5i"),
+                MainBoxWrite( p_intf, l, 1, _("| frames displayed :    %"PRId64),
                         p_item->p_stats->i_displayed_pictures );
                 SHOW_ACS( 1, ACS_VLINE ); l++;
-                MainBoxWrite( p_intf, l, 1, _("| frames lost      :    %5i"),
+                MainBoxWrite( p_intf, l, 1, _("| frames lost      :    %"PRId64),
                         p_item->p_stats->i_lost_pictures );
                 SHOW_ACS( 1, ACS_VLINE ); l++;
                 DrawEmptyLine( p_sys->w, p_sys->i_box_y + l - p_sys->i_box_start, 1, COLS - 2 );
@@ -2012,13 +2014,13 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
                 MainBoxWrite( p_intf, l, 1, _("+-[Audio Decoding]"));
                 SHOW_ACS( 1, ACS_LTEE );  SHOW_ACS( 2, ACS_HLINE ); l++;
                 if( p_sys->b_color ) wcolor_set( p_sys->w, C_DEFAULT, NULL );
-                MainBoxWrite( p_intf, l, 1, _("| audio decoded    :    %5i"),
+                MainBoxWrite( p_intf, l, 1, _("| audio decoded    :    %"PRId64),
                         p_item->p_stats->i_decoded_audio );
                 SHOW_ACS( 1, ACS_VLINE ); l++;
-                MainBoxWrite( p_intf, l, 1, _("| buffers played   :    %5i"),
+                MainBoxWrite( p_intf, l, 1, _("| buffers played   :    %"PRId64),
                         p_item->p_stats->i_played_abuffers );
                 SHOW_ACS( 1, ACS_VLINE ); l++;
-                MainBoxWrite( p_intf, l, 1, _("| buffers lost     :    %5i"),
+                MainBoxWrite( p_intf, l, 1, _("| buffers lost     :    %"PRId64),
                         p_item->p_stats->i_lost_abuffers );
                 SHOW_ACS( 1, ACS_VLINE ); l++;
                 DrawEmptyLine( p_sys->w, p_sys->i_box_y + l - p_sys->i_box_start, 1, COLS - 2 );
@@ -2031,8 +2033,8 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
             if( p_sys->b_color ) wcolor_set( p_sys->w, C_DEFAULT, NULL );
             MainBoxWrite( p_intf, l, 1, _("| packets sent     :    %5i"), p_item->p_stats->i_sent_packets );
             SHOW_ACS( 1, ACS_VLINE ); l++;
-            MainBoxWrite( p_intf, l, 1, _("| bytes sent       : %8.0f kB"),
-                    (float)(p_item->p_stats->i_sent_bytes)/1000 );
+            MainBoxWrite( p_intf, l, 1, _("| bytes sent       : %8.0f KiB"),
+                    (float)(p_item->p_stats->i_sent_bytes)/1024 );
             SHOW_ACS( 1, ACS_VLINE ); l++;
             MainBoxWrite( p_intf, l, 1, _("\\ sending bitrate  :   %6.0f kb/s"),
                     (float)(p_item->p_stats->f_send_bitrate*8)*1000 );
@@ -2166,7 +2168,7 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
         DrawEmptyLine( p_sys->w, 7, 1, COLS-2 );
         if( p_sys->psz_search_chain )
         {
-            if( strlen( p_sys->psz_search_chain ) == 0 &&
+            if( *p_sys->psz_search_chain == '\0' &&
                 p_sys->psz_old_search != NULL )
             {
                 /* Searching next entry */