[MPlayer-cvslog] r37170 - trunk/gui/interface.c

ib subversion at mplayerhq.hu
Thu Apr 24 15:08:38 CEST 2014


Author: ib
Date: Thu Apr 24 15:08:38 2014
New Revision: 37170

Log:
Rewrite add_vf().

Avoid confusing usage of i = -1 to indicate that a video filter
has been found. Check vf_settings[i].name instead.

As a result, the index of the video filter found won't be destroyed.

Modified:
   trunk/gui/interface.c

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Thu Apr 24 14:58:40 2014	(r37169)
+++ trunk/gui/interface.c	Thu Apr 24 15:08:38 2014	(r37170)
@@ -281,13 +281,13 @@ static void add_vf(const char *vf)
         int i = 0;
 
         while (vf_settings[i].name) {
-            if (strcmp(vf_settings[i++].name, vf) == 0) {
-                i = -1;
+            if (strcmp(vf_settings[i].name, vf) == 0)
                 break;
-            }
+
+            i++;
         }
 
-        if (i != -1) {
+        if (!vf_settings[i].name) {
             void *settings = realloc(vf_settings, (i + 2) * sizeof(m_obj_settings_t));
 
             if (!settings)


More information about the MPlayer-cvslog mailing list