[vlc-devel] [PATCH v2 12/15] preparser: art: use new md5 API

Marvin Scholz epirat07 at gmail.com
Wed Apr 8 00:04:28 CEST 2020


---
 src/preparser/art.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/preparser/art.c b/src/preparser/art.c
index f7dabbd725..77d168f06a 100644
--- a/src/preparser/art.c
+++ b/src/preparser/art.c
@@ -33,7 +33,7 @@
 #include <vlc_fs.h>
 #include <vlc_strings.h>
 #include <vlc_url.h>
-#include <vlc_md5.h>
+#include <vlc_hash.h>
 
 #include "art.h"
 
@@ -107,13 +107,12 @@ static char* ArtCacheGetDirPath( const char *psz_arturl, const char *psz_artist,
          * (We should never need to call this function if art has already been
          * downloaded anyway).
          */
-        struct md5_s md5;
-        InitMD5( &md5 );
-        AddMD5( &md5, psz_arturl, strlen( psz_arturl ) );
+        vlc_hash_md5_t md5;
+        vlc_hash_md5_Init( &md5 );
+        vlc_hash_md5_Update( &md5, psz_arturl, strlen( psz_arturl ) );
         if( !strncmp( psz_arturl, "attachment://", 13 ) )
-            AddMD5( &md5, psz_title, strlen( psz_title ) );
-        EndMD5( &md5 );
-        char * psz_arturl_sanitized = psz_md5_hash( &md5 );
+            vlc_hash_md5_Update( &md5, psz_title, strlen( psz_title ) );
+        char * psz_arturl_sanitized = vlc_hash_md5_FinishHex( &md5 );
         if( asprintf( &psz_dir, "%s" DIR_SEP "art" DIR_SEP "arturl" DIR_SEP
                       "%s", psz_cachedir, psz_arturl_sanitized ) == -1 )
             psz_dir = NULL;
-- 
2.24.1 (Apple Git-126)



More information about the vlc-devel mailing list