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

ib subversion at mplayerhq.hu
Mon Apr 28 18:08:54 CEST 2014


Author: ib
Date: Mon Apr 28 18:08:54 2014
New Revision: 37181

Log:
Copy subsequent video filter settings at once.

Count the existing settings following the deleted one
and copy them all at once.

Modified:
   trunk/gui/interface.c

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Mon Apr 28 18:02:20 2014	(r37180)
+++ trunk/gui/interface.c	Mon Apr 28 18:08:54 2014	(r37181)
@@ -170,14 +170,19 @@ static void remove_vf(char *vf)
 
         while (vf_settings[i].name) {
             if (strcmp(vf_settings[i].name, vf) == 0) {
+                int j;
+
                 mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_GUI_MSG_RemovingVideoFilter, vf);
 
                 free(vf_settings[i].name);
                 listFree(&vf_settings[i].attribs);
 
-                do
-                    memcpy(&vf_settings[i], &vf_settings[i + 1], sizeof(*vf_settings));
-                while (vf_settings[++i].name);
+                j = i + 1;
+
+                while (vf_settings[j].name)
+                    j++;
+
+                memmove(&vf_settings[i], &vf_settings[i + 1], (j - i) * sizeof(*vf_settings));
 
                 break;
             }


More information about the MPlayer-cvslog mailing list