[Ffmpeg-devel] alsa input / output

Måns Rullgård mans
Sun Mar 25 14:29:56 CEST 2007


Michael Niedermayer <michaelni at gmx.at> writes:

> Hi
>
> On Sun, Mar 25, 2007 at 11:48:19AM +0200, Reimar D?ffinger wrote:
>> Hello,
>> On Sun, Mar 25, 2007 at 05:26:16AM +0200, Michael Niedermayer wrote:
>> > > I should also note that such a lock-free implementation depends
>> > > on volatile keyword working "well enough" and pointer reads and
>> > > writes being atomic on the architecture...
>> > 
>> > could you show one example where volatile makes a difference in practice?
>> 
>> In practice maybe not, but in theory you could do
>> while (av_fifo_size(f) <= 0) sleep();
>> and the compiler might inline av_fifo_size (not gcc though unless we
>
> NO!!!
> no compiler can do this, it breaks the seperation of implementation and API
> no way to relink with a lavu with different fifo implementation ...
>
> any inlining must be limited to within lavu ...

That's not a problem if the library is linked statically.  I'm not
aware of linker that can do such inlining, but I'm pretty sure it's
allowed.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list