... if this is acceptable.
I need this in my
sink_pad.add_probe closure, because I'd like to avoid reading
Caps) on every buffer reception. So I defined a
Mutex<Option<AudioInfo>> initialized to
None outside of the closure. When the first buffer arrives, I read the
AudioInfo, set the
Some(audio_info) and reuse it for subsequent buffers.
Full code is here.