Commit bf8706f5 authored by Simon Morlat's avatar Simon Morlat

fix crash when x11 window is too small, and improve Xv detection in configure script

parent e3a50ec4
......@@ -152,13 +152,16 @@ AC_DEFUN([MS_CHECK_VIDEO],[
esac],[enable_xv=true])
if test "$enable_xv" = "true"; then
AC_CHECK_HEADERS(X11/extensions/Xv.h,[] ,[enable_xv=false])
AC_CHECK_HEADERS(X11/extensions/Xv.h,[] ,[enable_xv=false])
AC_CHECK_HEADERS(X11/extensions/Xvlib.h,[] ,[enable_xv=false],[
#include <X11/Xlib.h>
])
AC_CHECK_LIB(Xv,XvCreateImage,[LIBS="$LIBS -lXv"])
fi
fi
if ! test "$mingw_found" = "yes" ; then
if test "$enable_xv$sdl_found" == "nono" ; then
if test "$enable_xv$sdl_found" == "falsefalse" ; then
AC_MSG_ERROR([No video output API found. Install either X11+Xv headers or SDL library.])
fi
fi
......
......@@ -26,6 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern "C" {
#endif
#define MS_LAYOUT_MIN_SIZE 40
void ms_layout_compute(MSVideoSize wsize, MSVideoSize vsize, MSVideoSize orig_psize,
int localrect_pos, float scalefactor, MSRect *mainrect, MSRect *localrect);
......
......@@ -181,6 +181,10 @@ static void x11video_prepare(MSFilter *f){
}
XGetWindowAttributes(s->display,s->window_id,&wa);
ms_message("Window has size %i,%i",wa.width,wa.height);
if (wa.width<MS_LAYOUT_MIN_SIZE || wa.height<MS_LAYOUT_MIN_SIZE){
return;
}
s->fbuf.w=wa.width & ~0x1;
s->fbuf.h=wa.height & ~0x1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment