[LAD] [ANN] LV2 beta3

Robin Gareus robin at gareus.org
Fri May 11 12:55:09 UTC 2007



Dave Robillard wrote:
> 
> Can we figure out this sample rate thing before this gets really
> ugly? :)
>

Please use rational values. Hardly anyone ever resamples to an
irrational number and it's also needed to do proper A/V sync.

While it's true that most real-life applications will be happy with a
(double) - it can not guarantee exactness and most (double)-precision
bugs are hard to trace/detect in the source.

ffmpeg provides a simple API - see their `rational.h`

static inline double av_q2d(AVRational a){
    return a.num / (double) a.den;
}

2c,
robin



More information about the Linux-audio-dev mailing list