From 9a3aa1d854a3c8dcdf22cbe5db289425321b2499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20Ni=C3=9Fl?= Date: Sun, 15 Apr 2007 19:06:31 +0200 Subject: Initialize image size in bmiheader with data from AVCodecContext, if still uninitalized. --- src/libffmpeg/ff_video_decoder.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libffmpeg/ff_video_decoder.c b/src/libffmpeg/ff_video_decoder.c index e04c680b7..3943fd05d 100644 --- a/src/libffmpeg/ff_video_decoder.c +++ b/src/libffmpeg/ff_video_decoder.c @@ -1186,6 +1186,11 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) { if ((this->aspect_ratio_prio < 2) && av_cmp_q(this->context->sample_aspect_ratio, avr00)) { + if (!this->bih.biWidth || !this->bih.biHeight) { + this->bih.biWidth = this->context->width; + this->bih.biHeight = this->context->height; + } + this->aspect_ratio = av_q2d(this->context->sample_aspect_ratio) * (double)this->bih.biWidth / (double)this->bih.biHeight; this->aspect_ratio_prio = 2; -- cgit v1.2.3