Musepack Forums  

Go Back   Musepack Forums > Main > Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 28 December 2004, 09:20 pm   #1
kuniklo
Senior Member
 
kuniklo's Avatar
 
Join Date: Aug 2004
Location: Emeryville, CA
Posts: 52
Default xmms-musepack crashes on amd64 bit machine

Has anyone else experienced this? Seems to crash it every time I try to play an mpc file. I'll look into this if nobody else is already.
kuniklo is offline   Reply With Quote
Old 28 December 2004, 11:06 pm   #2
kuniklo
Senior Member
 
kuniklo's Avatar
 
Join Date: Aug 2004
Location: Emeryville, CA
Posts: 52
Default

Ok. I think I've figured out what's going on here.

The current xmms-musepack plugin code links in both glib-1.2 and glib-2.0. According to this bug in the redhat bug database:

https://bugzilla.redhat.com/bugzilla/show_b...g.cgi?id=131609

this is a no-no. I'm not sure why it only manifests itself on amd64 machines.

As a workaround I've just commented out the calls to the glib-2.0 utf8 string conversions functions, which seem to be the only reason the code needs glib-2.0. As an added bonus, I've ported the xmms plugin code to the new C libmusepack.

This work in progress is available on my svn server (http://www.caddr.com/svn and http://www.caddr.com/websvn).

It seems like a better solution would be to change the code to use libiconv for character conversion, right? At least I can listen to my mpc files on my amd64 machine now.
kuniklo is offline   Reply With Quote
Old 29 December 2004, 12:16 pm   #3
Lefungus
Procrastinator
 
Lefungus's Avatar
 
Join Date: Jul 2004
Posts: 131
Default

And then I lose all my unicode tags, so the libiconv is a better solution indeed.
Lefungus is offline   Reply With Quote
Old 29 December 2004, 06:58 pm   #4
kuniklo
Senior Member
 
kuniklo's Avatar
 
Join Date: Aug 2004
Location: Emeryville, CA
Posts: 52
Default

Ok. I've switched the conversion routine over to iconv and checked in the patch in svn. Seems to be working fine for reading tags, but I can't seem to write tags using the XMMS plugin.

Was this working before? I don't think I ever tried it.
kuniklo is offline   Reply With Quote
Old 29 December 2004, 09:19 pm   #5
kuniklo
Senior Member
 
kuniklo's Avatar
 
Join Date: Aug 2004
Location: Emeryville, CA
Posts: 52
Default

I've ported the bmp plugin over to the new C libmusepack as well. All the code is in my svn, as usual.
kuniklo is offline   Reply With Quote
Old 29 December 2004, 11:26 pm   #6
kuniklo
Senior Member
 
kuniklo's Avatar
 
Join Date: Aug 2004
Location: Emeryville, CA
Posts: 52
Default

Also, here's the glib -> iconv patch for the current xmms-musepack-1.1, if we want to release an updated version without waiting for the new C libmusepack.

diff -ru xmms-musepack-1.1/src/libmpc.cpp xmms-musepack-1.1-patched/src/libmpc.cpp
--- xmms-musepack-1.1/src/libmpc.cpp 2004-11-28 08:15:57.000000000 -0800
+++ xmms-musepack-1.1-patched/src/libmpc.cpp 2004-12-29 15:21:10.810832296 -0800
@@ -12,6 +12,7 @@
}
#include <glib.h>
#include <gtk/gtk.h>
+#include <iconv.h>
#include <math.h>
#include "tags.h"
#include "equalizer.h"
@@ -115,12 +116,28 @@
}
#endif

-static char* convertUTF8toLocale(char* utf8) {
- char* temp=g_locale_from_utf8 (utf8, -1, NULL, NULL, NULL);
- if(temp==NULL)
- return g_strdup(utf8);
- else
- return temp;
+static char*
+convertUTF8toLocale(char* utf8)
+{
+ // note - opens a new iconv descriptor for each call
+ // will have to find a way to reuse the descriptor if this turns
+ // out to be too slow
+ iconv_t idesc = iconv_open("", "UTF-8");
+ if (idesc == (iconv_t) -1) {
+ perror("iconv_open failed");
+ return g_strdup(utf8);
+ }
+
+ size_t in_left = strlen(utf8);
+ size_t out_left = 2 * in_left + 1;
+ char *buf = (char *)g_malloc(out_left);
+ char *in = utf8;
+ char *out = buf;
+
+ memset(buf, 0, out_left);
+ size_t err = iconv(idesc, &in, &in_left, &out, &out_left);
+ iconv_close(idesc);
+ return buf;
}

static void convertLE32to16(MPC_SAMPLE_FORMAT* sample_buffer, char* xmms_buffer, unsigned int status) {
kuniklo is offline   Reply With Quote
Old 04 January 2005, 04:49 pm   #7
Lefungus
Procrastinator
 
Lefungus's Avatar
 
Join Date: Jul 2004
Posts: 131
Default

Updated !
Lefungus is offline   Reply With Quote
Old 05 January 2005, 07:18 am   #8
Mr_Rabid_Teddybear
Member
 
Join Date: Sep 2004
Location: Bergen, Norway
Posts: 17
Default

Quote:
Updated !
INSTALL still says:
Quote:
Xmms-musepack plugin
Required:
GTK-1.2 headers and libs
Glib-2.0 headers and libs
Xmms-1.2.10 headers and binaries
To install:
run "./configure && make" as user
run "make install" as root
and in README theres no mention of changes for 1.1.1

Shouldn't Glib-2.0 be removed from list of dependencies? And aren't iconv a new dependency - or did I get that wrong?
Mr_Rabid_Teddybear is offline   Reply With Quote
Old 05 January 2005, 10:46 am   #9
Lefungus
Procrastinator
 
Lefungus's Avatar
 
Join Date: Jul 2004
Posts: 131
Default

Forgot to update text files... Fixed package will be online soon. Code is unchanged.
Lefungus is offline   Reply With Quote
Old 05 January 2005, 05:45 pm   #10
kuniklo
Senior Member
 
kuniklo's Avatar
 
Join Date: Aug 2004
Location: Emeryville, CA
Posts: 52
Default

I've ported the lamip plugin over to libmusepack as well. It's in my svn.
kuniklo is offline   Reply With Quote
Old 05 January 2005, 08:41 pm   #11
xmixahlx
Musepack developer
 
xmixahlx's Avatar
 
Join Date: Nov 2004
Location: seattle, washington usa
Posts: 111
Send a message via ICQ to xmixahlx
Default

i've told fred (lamip dev) of your changes and he'll port it to the 0.0.3 API

thanx kuniklo

the lamip devs could use some help if you are interested in the player


later
__________________
-xmixahlx, the one they call "mike"
http://xmixahlx.com -|- http://rarewares.org
xmixahlx is offline   Reply With Quote
Old 05 January 2005, 09:04 pm   #12
kuniklo
Senior Member
 
kuniklo's Avatar
 
Join Date: Aug 2004
Location: Emeryville, CA
Posts: 52
Default

Great. I'll see if I can find any time to help out with lamip. I've got several things I want to do with musepack first.
kuniklo is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to install musepack on Fedora Core 4 with xmms? someuser77 MPC for UNIX 1 09 December 2005 06:03 pm
xmms crashes ontarianfrog MPC for UNIX 5 22 March 2005 10:10 pm
Xmms / Beep plugins for musepack Lefungus MPC for UNIX 22 25 February 2005 05:41 pm
Does xmms' equalizer works with musepack plugin? qrt666 MPC for UNIX 4 27 September 2004 05:42 pm
Using XMMS with musepack superk MPC for UNIX 3 07 September 2004 05:54 pm


All times are GMT. The time now is 08:54 am.


Powered by vBulletin® Version 3.8.11 Beta 2
Copyright ©2000 - 2019, vBulletin Solutions Inc.