summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-05-23 21:20:12 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-05-23 21:20:12 +0000
commitb80b0cadd37739aa6a66788a523bab253c7d47b8 (patch)
treef4fb9f75daae584da41ddea19bae4bb21c35a055 /libvo
parent5b6efa44b24a8ac38d1fa80bb934db3e285751be (diff)
downloadmpv-b80b0cadd37739aa6a66788a523bab253c7d47b8.tar.bz2
mpv-b80b0cadd37739aa6a66788a523bab253c7d47b8.tar.xz
swscaler doesn't recognizes support for BGR1/BGR4 too, and so if forced it crashes, without checking the swsContext
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10178 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_x11.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c
index 3768d2b6fb..5418eac285 100644
--- a/libvo/vo_x11.c
+++ b/libvo/vo_x11.c
@@ -398,6 +398,8 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t
/* always allocate swsContext as size could change between frames */
swsContext= sws_getContextFromCmdLine(width, height, in_format, width, height, out_format );
+ if (!swsContext)
+ return -1;
//printf( "X11 bpp: %d color mask: R:%lX G:%lX B:%lX\n",bpp,myximage->red_mask,myximage->green_mask,myximage->blue_mask );
@@ -565,7 +567,7 @@ static uint32_t query_format( uint32_t format )
mp_msg(MSGT_VO,MSGL_DBG2,"vo_x11: query_format was called: %x (%s)\n",format,vo_format_name(format));
if (IMGFMT_IS_BGR(format))
{
- if (IMGFMT_BGR_DEPTH(format) == 8)
+ if (IMGFMT_BGR_DEPTH(format) <= 8)
return 0; // TODO 8bpp not yet fully implemented
if (IMGFMT_BGR_DEPTH(format) == vo_depthonscreen)
return 3|VFCAP_OSD|VFCAP_SWSCALE|VFCAP_FLIP|VFCAP_ACCEPT_STRIDE;