summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/xine-engine/info_helper.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/xine-engine/info_helper.c b/src/xine-engine/info_helper.c
index 273744149..05a24566c 100644
--- a/src/xine-engine/info_helper.c
+++ b/src/xine-engine/info_helper.c
@@ -20,7 +20,7 @@
* stream metainfo helper functions
* hide some xine engine details from demuxers and reduce code duplication
*
- * $Id: info_helper.c,v 1.12 2004/12/12 00:47:15 miguelfreitas Exp $
+ * $Id: info_helper.c,v 1.13 2004/12/19 19:28:58 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -195,20 +195,26 @@ static void __meta_info_set_unlocked_utf8(xine_stream_t *stream, int info, const
static void __meta_info_set_unlocked_encoding(xine_stream_t *stream, int info, const char *value, const char *enc) {
#ifdef HAVE_ICONV
iconv_t cd;
+ char *system_enc = NULL;
if (value) {
if (enc == NULL) {
- if ((enc = xine_get_system_encoding()) == NULL) {
+ if ((enc = system_enc = xine_get_system_encoding()) == NULL) {
xprintf(stream->xine, XINE_VERBOSITY_LOG,
_("info_helper: can't find out current locale character set\n"));
}
}
if (enc) {
- if ((cd = iconv_open("UTF-8", enc)) == (iconv_t)-1) {
+ cd = iconv_open("UTF-8", enc);
+ if (cd == (iconv_t)-1)
xprintf(stream->xine, XINE_VERBOSITY_LOG,
_("info_helper: unsupported conversion %s -> UTF-8, no conversion performed\n"), enc);
- } else {
+
+ if (system_enc)
+ free(system_enc);
+
+ if (cd != (iconv_t)-1) {
char *utf8_value;
char *inbuf, *outbuf;
size_t inbytesleft, outbytesleft;