~ubuntu-branches/ubuntu/quantal/ffmpeg/quantal

« back to all changes in this revision

Viewing changes to libavutil/rational.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2010-06-16 12:53:24 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20100616125324-kbhhjn7012ufc79t
Tags: 4:0.6-1ubuntu1
* merge from debian/experimental. remaining changes:
  - don't disable encoders
  - don't build against libfaad, libdirac and libopenjpeg (all in universe)
* new upstream release
  - internal vorbis encoder is disabled. LP: #585330
  - includes native AMR-NB decoder, LP: #93849
  - api-example is fixed: LP: #557319

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
#define LOG2  0.69314718055994530941723212145817656807550013436025
99
99
    int exponent= FFMAX( (int)(log(fabs(d) + 1e-20)/LOG2), 0);
100
100
    int64_t den= 1LL << (61 - exponent);
 
101
    if (isnan(d))
 
102
        return (AVRational){0,0};
101
103
    av_reduce(&a.num, &a.den, (int64_t)(d * den + 0.5), den, max);
102
104
 
103
105
    return a;