[vlc-commits] [Git][videolan/vlc][master] demux: sid: convert metadata encoding from cp-1252 to utf-8
Jean-Baptiste Kempf
gitlab at videolan.org
Fri Jun 11 20:52:00 UTC 2021
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
b34e29c0 by Nagy Tibor at 2021-06-11T15:34:59+00:00
demux: sid: convert metadata encoding from cp-1252 to utf-8
Fixes #6651
- - - - -
1 changed file:
- modules/demux/sid.cpp
Changes:
=====================================
modules/demux/sid.cpp
=====================================
@@ -34,6 +34,7 @@
#endif
#include <vlc_common.h>
+#include <vlc_charset.h>
#include <vlc_input.h>
#include <vlc_demux.h>
#include <vlc_plugin.h>
@@ -253,9 +254,17 @@ static int Control (demux_t *demux, int query, va_list args)
vlc_meta_t *p_meta = va_arg (args, vlc_meta_t *);
/* These are specified in the sid tune class as 0 = Title, 1 = Artist, 2 = Copyright/Publisher */
- vlc_meta_SetTitle( p_meta, sys->tuneInfo.infoString[0] );
- vlc_meta_SetArtist( p_meta, sys->tuneInfo.infoString[1] );
- vlc_meta_SetCopyright( p_meta, sys->tuneInfo.infoString[2] );
+ char *psz_title = FromCharset( "CP1252", sys->tuneInfo.infoString[0], strlen(sys->tuneInfo.infoString[0]) );
+ char *psz_artist = FromCharset( "CP1252", sys->tuneInfo.infoString[1], strlen(sys->tuneInfo.infoString[1]) );
+ char *psz_copyright = FromCharset( "CP1252", sys->tuneInfo.infoString[2], strlen(sys->tuneInfo.infoString[2]) );
+
+ vlc_meta_SetTitle( p_meta, psz_title );
+ vlc_meta_SetArtist( p_meta, psz_artist );
+ vlc_meta_SetCopyright( p_meta, psz_copyright );
+
+ free( psz_title );
+ free( psz_artist );
+ free( psz_copyright );
return VLC_SUCCESS;
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/b34e29c026c9f93b39cbd549b3e5986377882c07
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/b34e29c026c9f93b39cbd549b3e5986377882c07
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list