summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libffmpeg/ff_video_decoder.c5
1 files changed, 5 insertions, 0 deletions
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;