comparison mov.c @ 6211:6f6ecca6904a libavformat

In mov demuxer, only set sar if not already set, patch by Andrew Wason, rectalogic at rectalogic dot com Fixes issue #1754
author bcoudurier
date Thu, 01 Jul 2010 23:18:27 +0000
parents da46dcc05d4a
children 525a4e7c0d30
comparison
equal deleted inserted replaced
6210:da46dcc05d4a 6211:6f6ecca6904a
1800 dref->volume, dref->nlvl_from, dref->nlvl_to); 1800 dref->volume, dref->nlvl_from, dref->nlvl_to);
1801 } else 1801 } else
1802 sc->pb = c->fc->pb; 1802 sc->pb = c->fc->pb;
1803 1803
1804 if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { 1804 if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
1805 if (st->codec->width != sc->width || st->codec->height != sc->height) { 1805 if (!st->sample_aspect_ratio.num &&
1806 AVRational r = av_d2q(((double)st->codec->height * sc->width) / 1806 (st->codec->width != sc->width || st->codec->height != sc->height)) {
1807 ((double)st->codec->width * sc->height), INT_MAX); 1807 st->sample_aspect_ratio = av_d2q(((double)st->codec->height * sc->width) /
1808 if (st->sample_aspect_ratio.num) 1808 ((double)st->codec->width * sc->height), INT_MAX);
1809 st->sample_aspect_ratio = av_mul_q(st->sample_aspect_ratio, r);
1810 else
1811 st->sample_aspect_ratio = r;
1812 } 1809 }
1813 1810
1814 av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den, 1811 av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
1815 sc->time_scale*st->nb_frames, st->duration, INT_MAX); 1812 sc->time_scale*st->nb_frames, st->duration, INT_MAX);
1816 } 1813 }