[MPlayer-cvslog] r35282 - trunk/libmpcodecs/vd_black.c

upsuper subversion at mplayerhq.hu
Tue Oct 30 16:40:42 CET 2012


Author: upsuper
Date: Tue Oct 30 16:40:41 2012
New Revision: 35282

Log:
vd_black: simplify code

Simplify code by using macro and removing redundant if statement.

Modified:
   trunk/libmpcodecs/vd_black.c

Modified: trunk/libmpcodecs/vd_black.c
==============================================================================
--- trunk/libmpcodecs/vd_black.c	Tue Oct 30 12:33:14 2012	(r35281)
+++ trunk/libmpcodecs/vd_black.c	Tue Oct 30 16:40:41 2012	(r35282)
@@ -152,10 +152,8 @@ static void uninit(sh_video_t *sh)
     vd_black_ctx *ctx = sh->context;
 
     for (i = 0; i < MP_MAX_PLANES; ++i) {
-        if (ctx->planes[i]) {
-            free(ctx->planes[i]);
-            ctx->planes[i] = NULL;
-        }
+        free(ctx->planes[i]);
+        ctx->planes[i] = NULL;
     }
 
     free(ctx);
@@ -168,8 +166,7 @@ static mp_image_t* decode(sh_video_t *sh
     vd_black_ctx *ctx = sh->context;
     int i;
 
-    if (sh->num_buffered_pts !=
-            sizeof(sh->buffered_pts) / sizeof(sh->buffered_pts[0]) - 1)
+    if (sh->num_buffered_pts != FF_ARRAY_ELEMS(sh->buffered_pts) - 1)
         return NULL;
 
     mpi = mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, MP_IMGFLAG_PRESERVE,


More information about the MPlayer-cvslog mailing list