Revision c3aeaa54
libavformat/mov.c | ||
---|---|---|
1652 | 1652 |
} else |
1653 | 1653 |
sc->pb = c->fc->pb; |
1654 | 1654 |
|
1655 |
if (st->codec->codec_type == CODEC_TYPE_VIDEO &&
|
|
1656 |
(st->codec->width != sc->width || st->codec->height != sc->height)) {
|
|
1655 |
if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
|
|
1656 |
if (st->codec->width != sc->width || st->codec->height != sc->height) {
|
|
1657 | 1657 |
AVRational r = av_d2q(((double)st->codec->height * sc->width) / |
1658 | 1658 |
((double)st->codec->width * sc->height), INT_MAX); |
1659 | 1659 |
if (st->sample_aspect_ratio.num) |
1660 | 1660 |
st->sample_aspect_ratio = av_mul_q(st->sample_aspect_ratio, r); |
1661 | 1661 |
else |
1662 | 1662 |
st->sample_aspect_ratio = r; |
1663 |
} |
|
1664 |
|
|
1665 |
av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den, |
|
1666 |
sc->time_scale*st->nb_frames, st->duration, INT_MAX); |
|
1663 | 1667 |
} |
1664 | 1668 |
|
1665 | 1669 |
switch (st->codec->codec_id) { |
libavformat/utils.c | ||
---|---|---|
2218 | 2218 |
} |
2219 | 2219 |
for(i=0;i<ic->nb_streams;i++) { |
2220 | 2220 |
st = ic->streams[i]; |
2221 |
if(codec_info_nb_frames[i]>2) |
|
2221 |
if(codec_info_nb_frames[i]>2 && !st->avg_frame_rate.num)
|
|
2222 | 2222 |
av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den, |
2223 | 2223 |
(codec_info_nb_frames[i]-2)*(int64_t)st->time_base.den, |
2224 | 2224 |
codec_info_duration[i] *(int64_t)st->time_base.num, 60000); |
Also available in: Unified diff