What's the purpose of "rewind" on corking and uncorking?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2011-06-14 at 00:09 +0800, Lin, Mengdong wrote:
> Why a sink input and its sink need "rewind" on corking and uncorking?

Because corking and uncorking are events that should cause an immediate
effect in the output. That means that the already rendered data in the
sink buffer has to be thrown away.

> I don't quite understand the following code. Could somebody kindly
> shed light on it? And take ALSA sink for example, are there any valid
> (non-silent) data left in ALSA buffer after the rewinding?

No, in this case the sink buffer is rewound as far as possible, ie.
everything is thrown away.

When corking, we want that the audio in the stream buffer will be "taken
away" from the sink buffer, but we still want to keep the data in the
stream buffer. When uncorking, the sink should take back the same stream
data that was originally taken away from it.

I don't know if this helped much, but hopefully at least a bit...

-- 
Tanu



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux