[vlc-commits] [Git][videolan/vlc][master] 2 commits: modules: rename internal LoadImages to avoid collision with win32

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Jul 30 20:10:52 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
5ad24d90 by Steve Lhomme at 2023-07-30T19:48:28+00:00
modules: rename internal LoadImages to avoid collision with win32

See https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadimagea /
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadimagew

- - - - -
119aaf89 by Steve Lhomme at 2023-07-30T19:48:28+00:00
freetype: rework error code handling to use VLC_SUCCESS

- - - - -


3 changed files:

- modules/spu/logo.c
- modules/spu/rss.c
- modules/text_renderer/freetype/freetype.c


Changes:

=====================================
modules/spu/logo.c
=====================================
@@ -41,10 +41,6 @@
 #include <vlc_url.h>
 #include <vlc_image.h>
 
-#ifdef LoadImage
-#   undef LoadImage
-#endif
-
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
@@ -579,7 +575,7 @@ static int LogoCallback( vlc_object_t *p_this, char const *psz_var,
 /**
  * It loads the logo image into memory.
  */
-static picture_t *LoadImage( vlc_object_t *p_this, const char *psz_filename )
+static picture_t *LoadPicture( vlc_object_t *p_this, const char *psz_filename )
 {
     if( !psz_filename )
         return NULL;
@@ -668,7 +664,7 @@ static void LogoListLoad( vlc_object_t *p_this, logo_list_t *p_logo_list,
 
         msg_Dbg( p_this, "logo file name %s, delay %d, alpha %d",
                  psz_list, p_logo[i].i_delay, p_logo[i].i_alpha );
-        p_logo[i].p_pic = LoadImage( p_this, psz_list );
+        p_logo[i].p_pic = LoadPicture( p_this, psz_list );
         if( !p_logo[i].p_pic )
         {
             msg_Warn( p_this, "error while loading logo %s, will be skipped",


=====================================
modules/spu/rss.c
=====================================
@@ -541,12 +541,10 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
  * functions
  ***************************************************************************/
 
-#undef LoadImage /* do not conflict with Win32 API */
-
 /****************************************************************************
  * download and resize image located at psz_url
  ***************************************************************************/
-static picture_t *LoadImage( filter_t *p_filter, const char *psz_url )
+static picture_t *LoadPicture( filter_t *p_filter, const char *psz_url )
 {
     filter_sys_t *p_sys = p_filter->p_sys;
     video_format_t fmt_out;
@@ -938,7 +936,7 @@ static rss_feed_t* FetchRSS( filter_t *p_filter )
         /* If we have a image: load it if required */
         if( b_images && p_feed->psz_image && !p_feed->p_pic )
         {
-            p_feed->p_pic = LoadImage( p_filter, p_feed->psz_image );
+            p_feed->p_pic = LoadPicture( p_filter, p_feed->psz_image );
         }
 
         msg_Dbg( p_filter, "done with %s RSS/Atom feed", p_feed->psz_url );


=====================================
modules/text_renderer/freetype/freetype.c
=====================================
@@ -1014,7 +1014,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
     }
 
     /* */
-    int rv = VLC_SUCCESS;
+    int rv;
     FT_BBox bbox;
     int i_max_face_height;
 
@@ -1036,7 +1036,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
 
     /* Don't attempt to render text that couldn't be laid out
      * properly. */
-    if( !rv && text_block.i_count > 0 && bbox.xMin < bbox.xMax && bbox.yMin < bbox.yMax )
+    if( rv == VLC_SUCCESS && text_block.i_count > 0 && bbox.xMin < bbox.xMax && bbox.yMin < bbox.yMax )
     {
         const vlc_fourcc_t p_chroma_list_yuvp[] = { VLC_CODEC_YUVP, 0 };
         const vlc_fourcc_t p_chroma_list_rgba[] = { VLC_CODEC_RGBA, 0 };
@@ -1143,9 +1143,9 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
                             .blend =   BlendGlyphToARGB },
         };
 
+        rv = VLC_EGENERIC;
         for( const vlc_fourcc_t *p_chroma = p_chroma_list; *p_chroma != 0; p_chroma++ )
         {
-            rv = VLC_EGENERIC;
             if( *p_chroma == VLC_CODEC_YUVP )
                 rv = RenderYUVP( p_filter, p_region_out, text_block.p_laid,
                                  &regionbbox, &paddedbbox, &bbox );
@@ -1169,8 +1169,10 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
                                  *p_chroma,
                                  &p_region_out->fmt,
                                  drawfuncs[DRAW_ARGB] );
+            else
+                continue;
 
-            if( !rv )
+            if( rv == VLC_SUCCESS )
                 break;
         }
     }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/562f17326fb8b92856e57a522e96a5491c128ab2...119aaf895bc107d3cc67925aaaff0f5fe38ecdf9

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/562f17326fb8b92856e57a522e96a5491c128ab2...119aaf895bc107d3cc67925aaaff0f5fe38ecdf9
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list