Mercurial > mplayer.hg
comparison gui/interface.c @ 37085:aadeccf8159b
Copy subsequent video filter settings at once.
Count the existing settings following the deleted one
and copy them all at once.
author | ib |
---|---|
date | Mon, 28 Apr 2014 16:08:54 +0000 |
parents | e1453cdb2bed |
children | 91628537e24e |
comparison
equal
deleted
inserted
replaced
37084:e1453cdb2bed | 37085:aadeccf8159b |
---|---|
168 if (vf_settings) { | 168 if (vf_settings) { |
169 int i = 0; | 169 int i = 0; |
170 | 170 |
171 while (vf_settings[i].name) { | 171 while (vf_settings[i].name) { |
172 if (strcmp(vf_settings[i].name, vf) == 0) { | 172 if (strcmp(vf_settings[i].name, vf) == 0) { |
173 int j; | |
174 | |
173 mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_GUI_MSG_RemovingVideoFilter, vf); | 175 mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_GUI_MSG_RemovingVideoFilter, vf); |
174 | 176 |
175 free(vf_settings[i].name); | 177 free(vf_settings[i].name); |
176 listFree(&vf_settings[i].attribs); | 178 listFree(&vf_settings[i].attribs); |
177 | 179 |
178 do | 180 j = i + 1; |
179 memcpy(&vf_settings[i], &vf_settings[i + 1], sizeof(*vf_settings)); | 181 |
180 while (vf_settings[++i].name); | 182 while (vf_settings[j].name) |
183 j++; | |
184 | |
185 memmove(&vf_settings[i], &vf_settings[i + 1], (j - i) * sizeof(*vf_settings)); | |
181 | 186 |
182 break; | 187 break; |
183 } | 188 } |
184 | 189 |
185 i++; | 190 i++; |