summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Jager <t.jager@gmx.de>2013-08-15 15:04:10 +0200
committerTorsten Jager <t.jager@gmx.de>2013-08-15 15:04:10 +0200
commit76725a2eceff7360a565397b2f580e0d12063bf6 (patch)
treeebf806c6471eab6c6d1bd661843a36b3f10d70e0
parente5318f7f8fa3c9b6f09fd9d32202a61f86edc1d8 (diff)
downloadxine-lib-76725a2eceff7360a565397b2f580e0d12063bf6.tar.gz
xine-lib-76725a2eceff7360a565397b2f580e0d12063bf6.tar.bz2
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.
-rw-r--r--src/combined/ffmpeg/ff_video_decoder.c12
1 files 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);