Mercurial > mplayer.hg
changeset 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 | f19959d0bbc9 |
files | gui/interface.c |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/interface.c Mon Apr 28 16:02:20 2014 +0000 +++ b/gui/interface.c Mon Apr 28 16:08:54 2014 +0000 @@ -170,14 +170,19 @@ 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; }