---------- Forwarded message ----------
From: Daniel Schürmann <[email protected]>
Date: 2013/4/22
Subject: Re: [Mixxx-devel] Bug #1156569 Change Soundsource API to reading
float samples
To: James J Fagan <[email protected]>


Hi James,

Thank you for the patch, you heading in the right direction!

You code only compiles because of a bad hack in the legacy code. (Not your
fault)

The const attibute in the prototype is simply wrong

read(unsigned long size, const SAMPLE *buffer);

But instead of fixing this global it was fixed by local hacks like:

http://bazaar.launchpad.net/~mixxxdevelopers/mixxx/trunk/view/head:/mixxx/src/soundsourcemp3.cpp#L446
SAMPLE * destination = (SAMPLE *)_destination;

This removed the constant operator of the _destination data pointer.
But in your case it converts also the data pointer without converting the
Data the pointer is pointing at.

See also:
http://www.cprogramming.com/reference/pointers/const_pointers.html

Finally you have to call SampleUtil::convert from the read function of each
sound source.

The next step is to individual optimize it.
For soundsourcemp3 you should make madScale() returning floats.
This will bring an instant performance gain. :-)
You should also have a look at libmad fixed.h

Kind regards,

Daniel












2013/4/21 James J Fagan <[email protected]>

>
> Hey Everyone,
>
> I have been working on fixing the Soundsource API so that it can handle
> float samples. So far I have altered all necessary read methods to deal
> with CSAMPLE instead of SAMPLE as well as changed all the callers so that
> the code could compile. I have attached a diff file of these changes. I
> understand that this is wrong but I have just done this to see if it would
> compile properly. When i run mixxx and drag an  .mp3 onto a deck and
> attempt to play it back all i hear is odd noises. What I am still confused
> about is where would I call SampleUtil::convert and exactly how do I
> determine when its even required?
>
> Thanks,
> James
>
>
> ------------------------------------------------------------------------------
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
> _______________________________________________
> Get Mixxx, the #1 Free MP3 DJ Mixing software Today
> http://mixxx.org
>
>
> Mixxx-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mixxx-devel
>
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Get Mixxx, the #1 Free MP3 DJ Mixing software Today
http://mixxx.org


Mixxx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

Reply via email to