[vlc-commits] [Git][videolan/vlc][master] 2 commits: art: remove dead code

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri May 15 07:06:28 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
b8ffcc87 by Steve Lhomme at 2026-05-15T06:54:51+00:00
art: remove dead code

save_uid is never reached with i_ret different than VLC_SUCCESS.
So we can remove the test. And we can factorize setting the i_res to
VLC_SUCCESS when reaching that point.

CID #1693899

- - - - -
2e5dc285 by Steve Lhomme at 2026-05-15T06:54:51+00:00
art: factorize code to save the attachment

The code in the if() and the code before the save_uid was exactly
the same.

- - - - -


1 changed file:

- src/preparser/art.c


Changes:

=====================================
src/preparser/art.c
=====================================
@@ -528,16 +528,7 @@ int input_SaveArt( vlc_object_t *obj, input_item_t *p_item,
     /* Check if we already dumped it */
     struct stat s;
     if( !vlc_stat( psz_filename, &s ) )
-    {
-        if( b_attachment && psz_attachment_dir && psz_attachment_urlfile )
-        {
-            ArtCacheCreateDir( psz_attachment_dir );
-            ArtCacheWriteUriToFile( obj, psz_attachment_urlfile, psz_uri );
-        }
-        input_item_SetArtURL( p_item, psz_uri );
-        i_ret = VLC_SUCCESS;
         goto save_uid;
-    }
 
     /* Dump it otherwise */
     FILE *f = vlc_fopen( psz_filename, "wb" );
@@ -562,6 +553,7 @@ int input_SaveArt( vlc_object_t *obj, input_item_t *p_item,
         goto end;
     }
 
+save_uid:
     msg_Dbg( obj, "album art saved to %s", psz_filename );
     if( b_attachment && psz_attachment_dir && psz_attachment_urlfile )
     {
@@ -569,13 +561,8 @@ int input_SaveArt( vlc_object_t *obj, input_item_t *p_item,
         ArtCacheWriteUriToFile( obj, psz_attachment_urlfile, psz_uri );
     }
     input_item_SetArtURL( p_item, psz_uri );
-    i_ret = VLC_SUCCESS;
-
-save_uid:
-    /* save uid info */
-    if( i_ret != VLC_SUCCESS )
-        goto end;
 
+    i_ret = VLC_SUCCESS;
     char *uid = input_item_GetInfo( p_item, "uid", "md5" );
     if ( ! *uid )
     {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/163d5862c36d3158eeb65466e44d99d3da7b5133...2e5dc285c093b84111ea1000bb5dd0810fa315cb

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/163d5862c36d3158eeb65466e44d99d3da7b5133...2e5dc285c093b84111ea1000bb5dd0810fa315cb
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list