On 2013/07/03 16:46, Thomas Guillem <thomas.guil...@gmail.com> wrote:
> This repo contains the aMPD source code, and git submodules I hosted on my
> github. Thoses submodules contains MPD dependencies slightly modified to
> build on android (android-curl, android-libav, android-glib,
> android-libiconv and android-mpd).

I also want to port MPD to Android, but I'd like to avoid most of
these dependencies.  I started porting MPD to C++ to get rid of GLib,
which is a major pain of portability, which is funny because GLib's
goal is portability.

>  - I added the android output plugin, don't look at the code, it's quite
> ugly: I used Android AudioTrack class in C via a dlopen to "libmedia.so"
> and dlsym to AudioTrack symbols since you can't use C++ here. Indeed, if
> you do a "new  AudioTrack" in c++, the object size will depend on
> AudioTrack header. From my experience, a lot of android constructors change
> the c++ headers, and using and allocating an object with wrongs headers can
> lead to severe memory corruption.

Android supports OpenSLES, which is a more standard approach to
playing audio.  Have you thought about using that?

> I had one small issue during the port, MPD can't be run, stopped, and run
> again in the same process. I started to fix some finish and init function
> to free and reset NULL pointers. It worked but it was quite instable on the
> second run and I had some serious memory leaks, and then I choose the wrong
> and easy path: I decided to kill the Service on second run.

I don't see those fixes in your android-mpd.git.  Is this because you
copied all that code from main.c to libmpd.c and applied fixes in one
single commit?  This way, there's nothing I can merge.

All this duplicate code is a bad idea.  This means we have to fix bugs
in two source files.  This will break.

Additionally, you duplicated the Makefile.am in your
Android_SRC_FILES.mk.  Yet another chance for bugs.  We should only
maintain one build system.

Max

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team

Reply via email to