diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2007-08-16 22:01:54 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2007-08-16 22:01:54 +0000 |
commit | 2f3b419cf1adb07278f59a811dbb6b26ecabafa5 (patch) | |
tree | b3828db2cd0366f25ade7e82aa045d85f4b9c4ac | |
parent | aec783d42dbf78e80c882e9940c28c4ca4d34d25 (diff) | |
download | ffmpeg-2f3b419cf1adb07278f59a811dbb6b26ecabafa5.tar.gz |
Don't pre-scale default_duration to avoid precision loss in fps calculation.
closes Issue95
Originally committed as revision 10127 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/matroskadec.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index e6776367ef..dd39bbde11 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1089,7 +1089,7 @@ matroska_add_stream (MatroskaDemuxContext *matroska) if ((res = ebml_read_uint (matroska, &id, &num)) < 0) break; - track->default_duration = num/matroska->time_scale; + track->default_duration = num; break; } @@ -1100,7 +1100,7 @@ matroska_add_stream (MatroskaDemuxContext *matroska) &num)) < 0) break; if (!track->default_duration) - track->default_duration = 1000000000/(matroska->time_scale*num); + track->default_duration = 1000000000/num; break; } @@ -1407,7 +1407,7 @@ matroska_add_stream (MatroskaDemuxContext *matroska) uint64_t num; if ((res = ebml_read_uint(matroska, &id, &num)) < 0) break; - track->default_duration = num / matroska->time_scale; + track->default_duration = num; break; } @@ -2174,7 +2174,7 @@ matroska_read_header (AVFormatContext *s, if (track->default_duration) av_reduce(&st->codec->time_base.num, &st->codec->time_base.den, - track->default_duration, 1000, 30000); + track->default_duration, 1000000000, 30000); if(extradata){ st->codec->extradata = extradata; @@ -2283,7 +2283,7 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size, return res; } if (duration == AV_NOPTS_VALUE) - duration = matroska->tracks[track]->default_duration; + duration = matroska->tracks[track]->default_duration / matroska->time_scale; /* block_time (relative to cluster time) */ block_time = AV_RB16(data); |