[MPlayer-dev-eng] patch: can't display mp3
Yasuhiro Matsumoto
mattn_jp at hotmail.com
Tue Dec 21 14:28:24 CET 2004
Attila Kinali -
>Konnichi wa,
Konnichi wa too. :-)
best regards.
> > 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
ok, i added few comments.
(sorry, i'm not native speaker)
>[...]
>+ if (len == 0 || errno == E2BIG)
>+ {
>+ len = len + fromlen * 2 + 40;
>
>Where do these values come from ?
see the comment.
>+ 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
hmmm, i don't understand this.
remalloc(NULL, size) won't work on some environment.
and, we should write "malloc" and "realloc". and checking fail.
my part won't leak when fail of malloc().
>[...]
>
> 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.
ooops...
I attached newer.
please check this.
Thanks for your advices.
- Yasuhiro
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer_mp3_i18n.diff.gz
Type: application/x-gzip-compressed
Size: 1463 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20041221/343d4ab9/attachment.bin>
More information about the MPlayer-dev-eng
mailing list