diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-07-14 19:11:09 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-07-14 19:11:09 +0000 |
commit | 283c061936e5eaff8cd4c579370914ab9ddf0589 (patch) | |
tree | 30bf3104fcc14f2e10a0aad5f6e9797919dc0933 /libavformat/utils.c | |
parent | 54347c2f51a9aae0f45a55069513ffb340014e10 (diff) | |
download | ffmpeg-streaming-283c061936e5eaff8cd4c579370914ab9ddf0589.zip ffmpeg-streaming-283c061936e5eaff8cd4c579370914ab9ddf0589.tar.gz |
Remove common factors from timebase in av_set_pts_info().
Should fix issue313
Originally committed as revision 14232 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index d6bee90..851df6b 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3152,9 +3152,13 @@ void url_split(char *proto, int proto_size, void av_set_pts_info(AVStream *s, int pts_wrap_bits, int pts_num, int pts_den) { + unsigned int gcd= ff_gcd(pts_num, pts_den); s->pts_wrap_bits = pts_wrap_bits; - s->time_base.num = pts_num; - s->time_base.den = pts_den; + s->time_base.num = pts_num/gcd; + s->time_base.den = pts_den/gcd; + + if(gcd>1) + av_log(NULL, AV_LOG_DEBUG, "st:%d removing common factor %d from timebase\n", s->index, gcd); } /* fraction handling */ |