[MPlayer-cvslog] r37625 - trunk/libvo/vo_directfb2.c

reimar subversion at mplayerhq.hu
Mon Feb 8 22:20:52 CET 2016


Author: reimar
Date: Mon Feb  8 22:20:52 2016
New Revision: 37625

Log:
vo_directfb2: simplify fallback code.

Also avoids Coverity warning.

Modified:
   trunk/libvo/vo_directfb2.c

Modified: trunk/libvo/vo_directfb2.c
==============================================================================
--- trunk/libvo/vo_directfb2.c	Mon Feb  8 22:04:24 2016	(r37624)
+++ trunk/libvo/vo_directfb2.c	Mon Feb  8 22:20:52 2016	(r37625)
@@ -505,6 +505,8 @@ static int config(uint32_t s_width, uint
 // vm things
 
 	if (vm) {
+	    int i;
+	    static const uint8_t fallback_bpps[] = {24, 32, 16, 8, 0};
 	    videomode_t params;
 	    params.out_width=d_width;
 	    params.out_height=d_height;
@@ -533,17 +535,8 @@ static int config(uint32_t s_width, uint
 	    mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Config - trying to change videomode\n");
             DFBCHECK (dfb->EnumVideoModes(dfb,video_modes_callback,&params));
 	    ret=dfb->SetVideoMode(dfb,params.width,params.height,params.bpp);
-	    if (ret) {
-		ret=dfb->SetVideoMode(dfb,params.width,params.height,24);
-		    if (ret) {
-			ret=dfb->SetVideoMode(dfb,params.width,params.height,32);
-			    if (ret) {
-				ret=dfb->SetVideoMode(dfb,params.width,params.height,16);
-				    if (ret) {
-					ret=dfb->SetVideoMode(dfb,params.width,params.height,8);
-				    }
-			    }
-		    }
+	    for (i = 0; ret && fallback_bpps[i]; i++) {
+		ret=dfb->SetVideoMode(dfb,params.width,params.height,fallback_bpps[i]);
 	    }
 	} // vm end
 


More information about the MPlayer-cvslog mailing list