From 76725a2eceff7360a565397b2f580e0d12063bf6 Mon Sep 17 00:00:00 2001 From: Torsten Jager Date: Thu, 15 Aug 2013 15:04:10 +0200 Subject: ffmpeg_video_decoder: default to square pixels Prevent vo loop from calculating undefined aspect ratio from _padded_ image size, leading to black bars and unnecessary scaling. --- src/combined/ffmpeg/ff_video_decoder.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c index 662c52a71..59a724faa 100644 --- a/src/combined/ffmpeg/ff_video_decoder.c +++ b/src/combined/ffmpeg/ff_video_decoder.c @@ -234,13 +234,13 @@ static int get_buffer(AVCodecContext *context, AVFrame *av_frame){ if (!this->bih.biWidth || !this->bih.biHeight) { this->bih.biWidth = width; this->bih.biHeight = height; + } - if (this->aspect_ratio_prio == 0) { - this->aspect_ratio = (double)width / (double)height; - this->aspect_ratio_prio = 1; - lprintf("default aspect ratio: %f\n", this->aspect_ratio); - this->set_stream_info = 1; - } + if (this->aspect_ratio_prio == 0) { + this->aspect_ratio = (double)width / (double)height; + this->aspect_ratio_prio = 1; + lprintf("default aspect ratio: %f\n", this->aspect_ratio); + this->set_stream_info = 1; } avcodec_align_dimensions(context, &width, &height); -- cgit v1.2.3