HI Phil,
Some comments on the code, not specifically your patch:
- encodermp3.cpp:88 - look in encoderBuffer().
I see lots of bufferIn/OutGrow() calls, but nothing that's deleting
these buffers or ever shrinking them again. Is this a giant memory
leak? It looks like you're growing your buffers every single time
encodeBuffer() is called....
- encodeBuffer() again. I see a couple of fun lines of code like:
outsize = (int)((1.25 * size + 7200) + 1);
and
m_bufferOutSize = (int)((1.25 * 20000 + 7200) + 1); in initStream()
1) Can you please comment these lines of code? What are these
constants in there? (You commented the 20000 in your patch but not the
7200 or the 1.25.)
2) Why do we need growing buffers at all instead of just static buffers?
3) In bufferIn/OutGrow(), you're using sizeof(float), but you should
be using sizeof(CSAMPLE) for consistency.
Other stuff from your patch:
- delete encoder;
+ if ( m_pEncoder )
+ delete m_pEncoder;
+
----> In C++, "delete" does nothing if the pointer is null, so it is
unnecessary to add that if statement. (Google it if you don't believe
me.)
Lastly, to help us integrate Shoutcast stuff into the GUI, you may
want to add some Qt signals to EngineShoutcast like connected(),
disconnected(), etc.
Please fix up these things when you get a chance and send me a new patch...
Thanks,
Albert
On Thu, Oct 15, 2009 at 2:32 PM, mad jester <[email protected]> wrote:
> I have several updates for Shoutcast, including:
>
> * Rewrote the buffer code in EncoderMp3 to initialize and grow them
> with the same function. This makes for less redundant code and also
> makes sure that it doesn't use uninitialized values.
> * Moved all the encoder code to updateFromPreferences. It will now
> reinitialize the encoder if the format or bitrate changes.
> * Renaming encoder to m_pEncoder
>
> Should I revive features_shoutcast, wait for swift approval or just
> commit straight to trunk? Any comments or questions are also welcome.
>
> Have Fun!
>
> Madjester
>
> --
> -----BEGIN GEEK CODE BLOCK-----
> Version: 3.1
> GCS d--@>+ s(+):(-) a- C++(++++)$ ULC+++(++++) P+ L+++ E-() W++ N o? K
> w-- O? !M V PS+(+++) PE(-) Y+ !PGP !t !5 X(+) !R tv+ b++ DI+ D+ G e>++
> h r y+
> ------END GEEK CODE BLOCK------
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Mixxx-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mixxx-devel
>
>
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Mixxx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mixxx-devel