Skip to content

Commit

Permalink
vo: renderer size rounding wang-bin#570
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Jan 18, 2016
1 parent 1e93a27 commit 933b082
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/QtAV/private/VideoRenderer_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ class Q_AV_PRIVATE_EXPORT VideoRendererPrivate : public AVOutputPrivate
if (rendererAspectRatio >= dar) { //equals to original video aspect ratio here, also equals to out ratio
//renderer is too wide, use renderer's height, horizonal align center
const int h = renderer_height;
const int w = dar * qreal(h);
const int w = qRound(dar * qreal(h));
out_rect = QRect((renderer_width - w)/2, 0, w, h);
} else if (rendererAspectRatio < dar) {
//renderer is too high, use renderer's width
const int w = renderer_width;
const int h = qreal(w)/dar;
const int h = qRound(qreal(w)/dar);
out_rect = QRect(0, (renderer_height - h)/2, w, h);
}
out_aspect_ratio = outAspectRatio;
Expand Down

0 comments on commit 933b082

Please sign in to comment.