[vlc-devel] [PATCH] OSS audio: Use SNDCTL_DSP_GETODELAY rather than GETOSPACE.
Hans-Kristian Arntzen
maister at archlinux.us
Wed Jul 27 21:53:18 CEST 2011
On 07/27/2011 09:13 PM, Rémi Denis-Courmont wrote:
> Le mercredi 27 juillet 2011 21:53:21 Hans-Kristian Arntzen, vous avez écrit :
>> Found an issue with the OSS driver, hopefully changes are accepted to it
>> since it seemed to be really old.
> Errm, does GETODELAY really return a byte count?
> This would be rather counter-intuitive...
>
> On the cosmetic side, this would avoid duplicating the ifdef:
>
> +#ifdef SNDCTL_DSP_GETODELAY
> + if ( ioctl( p_sys->i_fd, SNDCTL_DSP_GETODELAY,&i_bytes )< 0 )
> +#endif
> {
>
Yes, GETODELAY returns latency in bytes. From OSSv4 documentation:
http://manuals.opensound.com/developer/SNDCTL_DSP_GETODELAY.html
"This ioctl call tells how long time it's going to take before the next
sample to be written gets played by the hardware. The delay is returned
in bytes and it can be converted to seconds by dividing it by
|sample_rate*num_of_channels*sample_size_in_bytes|."
Updated patch to avoid #ifdef duplication.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110727/c789dac2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-OSS-audio-output-Prefer-GETODELAY-over-GETOSPACE.patch
Type: text/x-patch
Size: 2219 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110727/c789dac2/attachment.bin>
More information about the vlc-devel
mailing list