예제 #1
0
파일: avutil.go 프로젝트: codesuki/go-libav
func (r *Rational) Nearest(rs []*Rational) *Rational {
	var nearest *Rational
	for _, r2 := range rs {
		if nearest == nil {
			nearest = r2
		} else {
			res := C.av_nearer_q(r.CAVRational, r2.CAVRational, nearest.CAVRational)
			if res > 0 {
				nearest = r2
			}
		}
	}
	return nearest
}
예제 #2
0
파일: avutil.go 프로젝트: codesuki/go-libav
func (r *Rational) Nearer(r2 *Rational, r3 *Rational) int {
	return int(C.av_nearer_q(r.CAVRational, r2.CAVRational, r3.CAVRational))
}