Subject: Re: audio and FIONREAD
To: None <,>
From: Daniel Carosone <>
List: tech-kern
Date: 05/25/2003 16:28:26
On Sun, May 25, 2003 at 10:29:45AM +1000, Daniel Carosone wrote:
> The capture loop of mencoder wants to know ahead of time how many
> bytes of audio data will be read from the device, so it can allocate
> packet buffers of the right size before reading.  It calls ioctl
> FIONREAD to learn this.

I found an answer for this question in the "seek" field in
AUDIO_GETINFO ioctl.  This was hiding in the documentation behind
"BSD Extension" until I looked more carefully.

With a quick change to mencoder to use this instead, it seems to
work fine, though I wonder if the overhead of this call isn't much
higher than need be, though perhaps that's lost in the overhead of
making either call at all?