mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-15 11:30:08 +01:00
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
This commit is contained in:
@@ -3152,9 +3152,13 @@ void url_split(char *proto, int proto_size,
|
|||||||
void av_set_pts_info(AVStream *s, int pts_wrap_bits,
|
void av_set_pts_info(AVStream *s, int pts_wrap_bits,
|
||||||
int pts_num, int pts_den)
|
int pts_num, int pts_den)
|
||||||
{
|
{
|
||||||
|
unsigned int gcd= ff_gcd(pts_num, pts_den);
|
||||||
s->pts_wrap_bits = pts_wrap_bits;
|
s->pts_wrap_bits = pts_wrap_bits;
|
||||||
s->time_base.num = pts_num;
|
s->time_base.num = pts_num/gcd;
|
||||||
s->time_base.den = pts_den;
|
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 */
|
/* fraction handling */
|
||||||
|
|||||||
Reference in New Issue
Block a user