[MPlayer-dev-eng] patch: can't display mp3

Attila Kinali attila at kinali.ch
Mon Dec 20 12:42:48 CET 2004


Konnichi wa,

On Mon, 20 Dec 2004 09:29:18 +0900
Yasuhiro Matsumoto <mattn_jp at hotmail.com> wrote:

> Ok, please check this.

--- libmpdemux/demuxer.c.orig	2004-11-26 07:24:00.000000000 +0900
+++ libmpdemux/demuxer.c	2004-12-20 09:19:22.000000000 +0900
@@ -21,6 +21,15 @@
+iconv_string(iconv_t fd, char *str)
+{

You should add here a documentation entry, 
see DOCS/tech/code-documentation.txt


[...]
+		if (len == 0 || errno == E2BIG)
+		{
+			len = len + fromlen * 2 + 40;

Where do these values come from ?

+			p = (char*)malloc((unsigned)len);
+			if (p != NULL && done > 0)
+				memcpy(p, result, done);
+			free(result);
+			result = p;
+			if (result == NULL)
+				break;
+		}

A realloc() would be cleaner here

[...]

 int demux_info_print(demuxer_t *demuxer)
 {
     char **info = demuxer->info;
     int n;
+#ifdef USE_LANGINFO
+	extern char* sub_cp;
+    iconv_t info_conv = (iconv_t)-1;
+    if (sub_cp && *sub_cp) {
+#ifdef USE_LANGINFO
+      info_conv = iconv_open(nl_langinfo(CODESET), sub_cp);
+#else
+      info_conv = iconv_open(setlocale(LC_CTYPE, NULL), sub_cp);
+#endif
+    }
+#endif

The inner #ifdef looks like a mistake, at least the
else part is never executed.
 
Otherwise, it looks ok.

				Attila Kinali 

-- 
All christians are terrorists.




More information about the MPlayer-dev-eng mailing list