Mercurial > libavformat.hg
comparison utils.c @ 4242:44f4dca12784 libavformat
export gcd function as av_gcd()
| author | aurel |
|---|---|
| date | Sat, 17 Jan 2009 11:13:33 +0000 |
| parents | c3102b189cb6 |
| children | 964903243e66 |
comparison
equal
deleted
inserted
replaced
| 4241:c507e877c0ee | 4242:44f4dca12784 |
|---|---|
| 2725 static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_output) | 2725 static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_output) |
| 2726 { | 2726 { |
| 2727 char buf[256]; | 2727 char buf[256]; |
| 2728 int flags = (is_output ? ic->oformat->flags : ic->iformat->flags); | 2728 int flags = (is_output ? ic->oformat->flags : ic->iformat->flags); |
| 2729 AVStream *st = ic->streams[i]; | 2729 AVStream *st = ic->streams[i]; |
| 2730 int g = ff_gcd(st->time_base.num, st->time_base.den); | 2730 int g = av_gcd(st->time_base.num, st->time_base.den); |
| 2731 avcodec_string(buf, sizeof(buf), st->codec, is_output); | 2731 avcodec_string(buf, sizeof(buf), st->codec, is_output); |
| 2732 av_log(NULL, AV_LOG_INFO, " Stream #%d.%d", index, i); | 2732 av_log(NULL, AV_LOG_INFO, " Stream #%d.%d", index, i); |
| 2733 /* the pid is an important information, so we display it */ | 2733 /* the pid is an important information, so we display it */ |
| 2734 /* XXX: add a generic system */ | 2734 /* XXX: add a generic system */ |
| 2735 if (flags & AVFMT_SHOW_IDS) | 2735 if (flags & AVFMT_SHOW_IDS) |
| 3190 } | 3190 } |
| 3191 | 3191 |
| 3192 void av_set_pts_info(AVStream *s, int pts_wrap_bits, | 3192 void av_set_pts_info(AVStream *s, int pts_wrap_bits, |
| 3193 int pts_num, int pts_den) | 3193 int pts_num, int pts_den) |
| 3194 { | 3194 { |
| 3195 unsigned int gcd= ff_gcd(pts_num, pts_den); | 3195 unsigned int gcd= av_gcd(pts_num, pts_den); |
| 3196 s->pts_wrap_bits = pts_wrap_bits; | 3196 s->pts_wrap_bits = pts_wrap_bits; |
| 3197 s->time_base.num = pts_num/gcd; | 3197 s->time_base.num = pts_num/gcd; |
| 3198 s->time_base.den = pts_den/gcd; | 3198 s->time_base.den = pts_den/gcd; |
| 3199 | 3199 |
| 3200 if(gcd>1) | 3200 if(gcd>1) |
