vlc | branch: master | Marvin Scholz <[email protected]> | Wed Apr 1 15:50:06 2020 +0200| [6b07642188dc3aeabea0ae7bf1b3e7a0cfe92c90] | committer: Marvin Scholz
lua: sd: use new md5 API > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6b07642188dc3aeabea0ae7bf1b3e7a0cfe92c90 --- modules/lua/libs/sd.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/modules/lua/libs/sd.c b/modules/lua/libs/sd.c index 7f6c085fb3..7068ec8f90 100644 --- a/modules/lua/libs/sd.c +++ b/modules/lua/libs/sd.c @@ -37,7 +37,8 @@ #include <vlc_common.h> #include <vlc_services_discovery.h> #include <vlc_charset.h> -#include <vlc_md5.h> +#include <vlc_strings.h> +#include <vlc_hash.h> #include "../vlc.h" #include "../libs.h" @@ -215,15 +216,13 @@ static input_item_t *vlclua_sd_create_item( services_discovery_t *p_sd, char *s = strdup( luaL_checkstring( L, -1 ) ); if ( s ) { - struct md5_s md5; - InitMD5( &md5 ); - AddMD5( &md5, s, strlen( s ) ); - EndMD5( &md5 ); - free( s ); - s = psz_md5_hash( &md5 ); - if ( s ) - input_item_AddInfo( p_input, "uid", "md5", "%s", s ); + vlc_hash_md5_t md5; + vlc_hash_md5_Init( &md5 ); + vlc_hash_md5_Update( &md5, s, strlen( s ) ); free( s ); + char tmp[VLC_HASH_MD5_DIGEST_HEX_SIZE]; + vlc_hash_FinishHex( &md5, tmp ); + input_item_AddInfo( p_input, "uid", "md5", "%s", tmp ); } } lua_pop( L, 1 ); _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
