[Ffmpeg-devel] alsa input / output

Måns Rullgård mans
Sun Mar 25 15:17:18 CEST 2007


Michael Niedermayer <michaelni at gmx.at> writes:

> Hi
>
> On Sun, Mar 25, 2007 at 01:29:56PM +0100, M?ns Rullg?rd wrote:
>> 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.
>
> the linker would have to disassemble the code ...

I didn't say it would be easy, only that the usual standards do not
prohibit it.

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




More information about the ffmpeg-devel mailing list