On Wed, Jul 3, 2013 at 5:00 PM, Max Kellermann <m...@duempel.org> wrote:

> 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.
>

OK, maybe we should team up...


> >  - 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?


Yes but too late for my first version.
I think I'll have a closer look soon, since what I did is too ugly (but
working and ALL devices).


> > 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.
>

I dropped my finish() patches by error (a wrong git stash clear) when I
decided to use the easy way.
If you want, I can have a closer look but maybe I should wait for your port
to C++, no ?

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

I agree, you can't merge libmpd.c, I thought you didn't planned to include
that part that is really specific to the android way to run mpd.
But I still can factorize main and libmpd if you want.

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

Yes, I should have done an Android.mk including the Makefile.am (like I did
for the libav project).
Again I'll have a look.


> 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