Hi Wesley,

This is more Qt wierdness I think than multi-threading specifically. I
assume your problem is that QTcpSocket is going to call back to your
code at some point using slots and signals. This shouldn't be a
problem because the event loop is running globally throughout the
whole application. The only thing you do need to be careful of is that
any of your code which is triggered by those callbacks will probably
be running inside the event handler which means that if it takes a
long time you're delaying processing of user interface events and so
on.

Or if your problem is really something else then I'm sure we can solve
that too :)

Adam

On 04/03/2008, Wesley S. <[EMAIL PROTECTED]> wrote:
> I need some help with the shoutcast code.
> I'm having some multithreading issues that I don't know how to solve on my
> own.
>
> Right now EngineShoutcast is created on the heap in EngineSidechain
> somewhere.
>  EngineSidechain is responsable for filling a buffer with audio data.
> When this buffer is filled, EngineShoutcast's process() function is called.
> The EngineShoutcast process() function basically just passes all audio data
> on to an EncoderVorbis that it is tied to.
>  The EncoderVorbis then gives encoded samples back to EngineShoutcast.
> Finally, EngineShoutcast uses libshout to send the data to a Shout/Icecast
> server.
>
> Libshout, however, is very buggy, and I want to implement my own
> Icecast/Shoutcast interface,
>  based on QTcpSocket and by borrowing some code from DarkIce.
>
> But here is the first problem.
> If I'm not mistaken (I know little about multithreading), the thread where
> EngineShoutcast is running does not have an event loop,
>  which is needed to make event-based processing for the QTcpSocket work like
> it should.
>
> How should I fix that?
>
> Create the QTcpSocket outside of EngineShoutcast in the main thread?
> or put the whole EngineShoutcast in the main thread and only put the
> EncoderVorbis in the sidechain somehow?
>  or maybe I'm just missing the big picture.
>
> Any help is appreciated,
>
> --
> Wesley Stessens <[EMAIL PROTECTED]>
> Human Knowledge Belongs To The World - Antitrust (2001)
>  http://wesley.debianbox.be
> -------------------------------------------------------------------------
>  This SF.net email is sponsored by: Microsoft
>  Defy all challenges. Microsoft(R) Visual Studio 2008.
>  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
>  Mixxx-devel mailing list
>  [email protected]
>  https://lists.sourceforge.net/lists/listinfo/mixxx-devel
>
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Mixxx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

Reply via email to