comparison mov.c @ 5562:5d938dd16b34 libavformat

set average frame rate in mov demuxer
author bcoudurier
date Mon, 18 Jan 2010 23:56:04 +0000
parents 067c0af56a4c
children 9baa7b82a840
comparison
equal deleted inserted replaced
5561:067c0af56a4c 5562:5d938dd16b34
1650 st->index, dref->path, dref->dir, dref->filename, 1650 st->index, dref->path, dref->dir, dref->filename,
1651 dref->volume, dref->nlvl_from, dref->nlvl_to); 1651 dref->volume, dref->nlvl_from, dref->nlvl_to);
1652 } else 1652 } else
1653 sc->pb = c->fc->pb; 1653 sc->pb = c->fc->pb;
1654 1654
1655 if (st->codec->codec_type == CODEC_TYPE_VIDEO && 1655 if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
1656 (st->codec->width != sc->width || st->codec->height != sc->height)) { 1656 if (st->codec->width != sc->width || st->codec->height != sc->height) {
1657 AVRational r = av_d2q(((double)st->codec->height * sc->width) / 1657 AVRational r = av_d2q(((double)st->codec->height * sc->width) /
1658 ((double)st->codec->width * sc->height), INT_MAX); 1658 ((double)st->codec->width * sc->height), INT_MAX);
1659 if (st->sample_aspect_ratio.num) 1659 if (st->sample_aspect_ratio.num)
1660 st->sample_aspect_ratio = av_mul_q(st->sample_aspect_ratio, r); 1660 st->sample_aspect_ratio = av_mul_q(st->sample_aspect_ratio, r);
1661 else 1661 else
1662 st->sample_aspect_ratio = r; 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 switch (st->codec->codec_id) { 1669 switch (st->codec->codec_id) {
1666 #if CONFIG_H261_DECODER 1670 #if CONFIG_H261_DECODER
1667 case CODEC_ID_H261: 1671 case CODEC_ID_H261: