comparison mov.c @ 5561:067c0af56a4c libavformat

move aspect ratio code at the end of the track parsing, fix cathedral-beta2-400extra-crop-avc.mp4
author bcoudurier
date Mon, 18 Jan 2010 21:38:39 +0000
parents 4f6eb8fc81ec
children 5d938dd16b34
comparison
equal deleted inserted replaced
5560:e09092917f7e 5561:067c0af56a4c
922 get_be32(pb); /* temporal quality */ 922 get_be32(pb); /* temporal quality */
923 get_be32(pb); /* spatial quality */ 923 get_be32(pb); /* spatial quality */
924 924
925 st->codec->width = get_be16(pb); /* width */ 925 st->codec->width = get_be16(pb); /* width */
926 st->codec->height = get_be16(pb); /* height */ 926 st->codec->height = get_be16(pb); /* height */
927
928 if (st->codec->width != sc->width || st->codec->height != sc->height) {
929 AVRational r = av_d2q(
930 ((double)st->codec->height * sc->width) /
931 ((double)st->codec->width * sc->height), INT_MAX);
932 if (st->sample_aspect_ratio.num)
933 st->sample_aspect_ratio = av_mul_q(st->sample_aspect_ratio, r);
934 else
935 st->sample_aspect_ratio = r;
936 }
937 927
938 get_be32(pb); /* horiz resolution */ 928 get_be32(pb); /* horiz resolution */
939 get_be32(pb); /* vert resolution */ 929 get_be32(pb); /* vert resolution */
940 get_be32(pb); /* data size, always 0 */ 930 get_be32(pb); /* data size, always 0 */
941 get_be16(pb); /* frames per samples */ 931 get_be16(pb); /* frames per samples */
1659 "filename='%s', volume='%s', nlvl_from=%d, nlvl_to=%d\n", 1649 "filename='%s', volume='%s', nlvl_from=%d, nlvl_to=%d\n",
1660 st->index, dref->path, dref->dir, dref->filename, 1650 st->index, dref->path, dref->dir, dref->filename,
1661 dref->volume, dref->nlvl_from, dref->nlvl_to); 1651 dref->volume, dref->nlvl_from, dref->nlvl_to);
1662 } else 1652 } else
1663 sc->pb = c->fc->pb; 1653 sc->pb = c->fc->pb;
1654
1655 if (st->codec->codec_type == CODEC_TYPE_VIDEO &&
1656 (st->codec->width != sc->width || st->codec->height != sc->height)) {
1657 AVRational r = av_d2q(((double)st->codec->height * sc->width) /
1658 ((double)st->codec->width * sc->height), INT_MAX);
1659 if (st->sample_aspect_ratio.num)
1660 st->sample_aspect_ratio = av_mul_q(st->sample_aspect_ratio, r);
1661 else
1662 st->sample_aspect_ratio = r;
1663 }
1664 1664
1665 switch (st->codec->codec_id) { 1665 switch (st->codec->codec_id) {
1666 #if CONFIG_H261_DECODER 1666 #if CONFIG_H261_DECODER
1667 case CODEC_ID_H261: 1667 case CODEC_ID_H261:
1668 #endif 1668 #endif