summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-03-19 23:34:50 +0100
committerwm4 <wm4@nowhere>2013-03-19 23:34:50 +0100
commit594ad5acc2172de0d38897ef83b04536d93a8889 (patch)
treeb525d230c77e3b77b71936118b9d6c015896b074 /video
parentef7975e91b561f77cfa72c4aec9cd694e32f944d (diff)
downloadmpv-594ad5acc2172de0d38897ef83b04536d93a8889.tar.bz2
mpv-594ad5acc2172de0d38897ef83b04536d93a8889.tar.xz
video: deal with 0x0 window size
If this happens, don't set a NaN aspect ratio.
Diffstat (limited to 'video')
-rw-r--r--video/out/aspect.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/video/out/aspect.c b/video/out/aspect.c
index f85b75778b..0259c0f3ea 100644
--- a/video/out/aspect.c
+++ b/video/out/aspect.c
@@ -16,6 +16,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <libavutil/common.h>
+
/* Stuff for correct aspect scaling. */
#include "aspect.h"
#include "vo.h"
@@ -65,8 +67,8 @@ static void aspect_calc(struct vo *vo, int *srcw, int *srch)
struct aspect_data *aspdat = &vo->aspdat;
float pixelaspect = aspdat->monitor_par;
- int fitw = vo->dwidth;
- int fith = vo->dheight;
+ int fitw = FFMAX(1, vo->dwidth);
+ int fith = FFMAX(1, vo->dheight);
mp_msg(MSGT_VO, MSGL_DBG2, "aspect(0) fitin: %dx%d monitor_par: %.2f\n",
fitw, fith, aspdat->monitor_par);