[vlc-devel] patch to convert the duplicate module from single threaded to multithreaded

Ilkka Ollakka ileoo at porogrammer.org
Sun Sep 2 18:55:55 CEST 2012


On Sat, Sep 01, 2012 at 06:54:54PM +0200, Sergio M. Ammirata, Ph.D. wrote:
> The following patch will change the behavior of the duplicate module of the
> stream output chain so that each output is on a different thread. This
> solves the problem that happens when you have two outputs and one of them
> calls a blocking network call for example, i.e. the other one is blocked as
> well.

Hi, thanks for sending this, few questions inline

> +static void *Thread(void *data)
> +{
> +    const struct duplicate *d = data;
> +    for (;;) {
> +        const size_t s = sizeof(void*);
> +        block_t *block = block_FifoGet(d->fifo);
> +        if (!block)
> +            break;


> +        void **sid = (void**)(((uintptr_t)block->p_buffer + block->i_buffer + s) & ~s);
> +        sout_stream_id_t *id = *sid;

Is this really good way to get sout_stream_id_t ? If I read this correctly,
you use only one thread to handle StreamIdSend-stuff? Why not own thread for 
every duplicate. And why not pass that id in struct duplicate then.

-- 
Ilkka Ollakka



More information about the vlc-devel mailing list