[FFmpeg-devel] [PATCH] libavdevice: JACK demuxer

Reimar Döffinger Reimar.Doeffinger
Sat Mar 7 16:32:53 CET 2009

On Sat, Mar 07, 2009 at 04:10:32PM +0100, Michael Niedermayer wrote:
> What you didnt consider though is that we will need a similar buffer for OSS
> and possibly others, the jack ringbuffer cant be used for these.
> because we cant use jacks ringbuffer we need our own no matter what amount of
> extra bugfixing that involves, using jacks ringbuffer in one piece of code 
> and our own in another is no gain it just means more code& more bugs.
> and after rethinking the code, iam pretty sure any such buffer will need
> memory barriers on some cpus

Note that MPlayer already has about 3 implementations of such a ring buffer
(admittedly it assumes atomic reads and writes to ints) e.g. in
libao2/ao_sdl.c and libao2/ao_jack.c, a implementation in libavutil
would be welcome thus.
I was once thinking about just using fifo.c, but since it uses bytes
as basic unit (instead of a e.g. 1kB block), it allocates exactly one
additional byte, causing alignment issues after the first loop through
the buffer.

More information about the ffmpeg-devel mailing list