From 1270b6dab067110e081e65e09d1c2e3d5f330c04 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 6 Nov 2003 22:34:20 +0000 Subject: [PATCH] fallback to non-iconv dummy utf16 conversion if iconv failed git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11404 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/asf_mmst_streaming.c | 62 ++++++++++++++------------------- 1 file changed, 27 insertions(+), 35 deletions(-) diff --git a/libmpdemux/asf_mmst_streaming.c b/libmpdemux/asf_mmst_streaming.c index de09d7abc7..4e170b1dce 100644 --- a/libmpdemux/asf_mmst_streaming.c +++ b/libmpdemux/asf_mmst_streaming.c @@ -110,50 +110,36 @@ static void send_command (int s, int command, uint32_t switches, #ifdef USE_ICONV static iconv_t url_conv; - -static void string_utf16_open() { - setlocale(LC_CTYPE, ""); - url_conv = iconv_open("UTF-16LE",setlocale(LC_CTYPE, NULL)); -} - -static void string_utf16_close() { - - iconv_close(url_conv); -} +#endif static void string_utf16(char *dest, char *src, int len) { + int i; +#ifdef USE_ICONV size_t len1, len2; char *ip, *op; + if (url_conv != -1) + { memset(dest, 0, 1000); len1 = len; len2 = 1000; ip = src; op = dest; iconv(url_conv, &ip, &len1, &op, &len2); -} - -#else - -static void string_utf16_open() { -} - -static void string_utf16_close() { -} - -static void string_utf16(char *dest, char *src, int len) -{ - int i; - - for (i=0; ihostname); string_utf16 (data, str, strlen(str)); @@ -598,7 +587,10 @@ int asf_mmst_streaming_start(stream_t *stream) packet_length1 = packet_length; printf("mmst packet_length = %d\n",packet_length); - string_utf16_close(); +#ifdef USE_ICONV + if (url_conv != -1) + iconv_close(url_conv); +#endif return 0; }