Mercurial > mplayer.hg
changeset 35460:7d1d7f783975
Add listMgr command PLAYLIST_ITEM_FIND.
Search for a specific entry in the list.
author | ib |
---|---|
date | Sun, 02 Dec 2012 00:42:13 +0000 |
parents | 1edb306bc754 |
children | b7696c82c72d |
files | gui/util/list.c gui/util/list.h |
diffstat | 2 files changed, 16 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/util/list.c Sun Dec 02 00:38:14 2012 +0000 +++ b/gui/util/list.c Sun Dec 02 00:42:13 2012 +0000 @@ -96,6 +96,21 @@ } else return listMgr(PLAYLIST_ITEM_APPEND, pdat); + case PLAYLIST_ITEM_FIND: + + if (plList) { + plItem *item = plList; + + do { + if (gstrcmp(item->path, pdat->path) == 0 && gstrcmp(item->name, pdat->name) == 0) + return item; + + item = item->next; + } while (item); + } + + return NULL; + case PLAYLIST_ITEM_SET_CURR: plCurrent = pdat;