From d2db0f3bbdc81aae2c316751daf1d53b42a3e6a0 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Mon, 16 Sep 2002 21:49:34 +0000 Subject: - sync ffmpeg to cvs (sorry Mike it still doesn't decode your teststream -- something must be broken at ffmpeg, also happens with mplayer) - added priority sorted lists, now autoprobing should work again. - fixed infinite loop in plugin loader. obs: latest ffmpeg contains ppc optimizations, someone will have to enable these though. CVS patchset: 2676 CVS date: 2002/09/16 21:49:34 --- src/xine-utils/list.c | 49 +++++++++++++++++++++++++++++++++++++++++++++- src/xine-utils/xineutils.h | 11 +++++++++-- 2 files changed, 57 insertions(+), 3 deletions(-) (limited to 'src/xine-utils') diff --git a/src/xine-utils/list.c b/src/xine-utils/list.c index 1ef36fb05..56ba961ef 100644 --- a/src/xine-utils/list.c +++ b/src/xine-utils/list.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: list.c,v 1.2 2002/09/04 23:31:13 guenter Exp $ + * $Id: list.c,v 1.3 2002/09/16 21:49:35 miguelfreitas Exp $ * */ #ifdef HAVE_CONFIG_H @@ -139,6 +139,53 @@ void *xine_list_prev_content (xine_list_t *l) { } } +void xine_list_append_priority_content (xine_list_t *l, void *content, int priority) { + xine_node_t *node; + + node = (xine_node_t *) xine_xmalloc(sizeof(xine_node_t)); + node->content = content; + node->priority = priority; + + if (l->first) { + xine_node_t *cur; + + cur = l->first; + + while(1) { + if( priority >= cur->priority ) { + node->next = cur; + node->prev = cur->prev; + + if( node->prev ) + node->prev->next = node; + else + l->first = node; + cur->prev = node; + + l->cur = node; + break; + } + + if( !cur->next ) { + node->next = NULL; + node->prev = cur; + cur->next = node; + + l->cur = node; + l->last = node; + break; + } + + cur = cur->next; + } + } + else { + l->first = l->last = l->cur = node; + node->prev = node->next = NULL; + } +} + + void xine_list_append_content (xine_list_t *l, void *content) { xine_node_t *node; diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h index 9875da713..1da508c61 100644 --- a/src/xine-utils/xineutils.h +++ b/src/xine-utils/xineutils.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xineutils.h,v 1.22 2002/09/04 23:31:14 guenter Exp $ + * $Id: xineutils.h,v 1.23 2002/09/16 21:49:35 miguelfreitas Exp $ * */ #ifndef XINEUTILS_H @@ -786,13 +786,15 @@ extern int v_g_table[256]; extern int v_b_table[256]; -/******** double cained lists with builtin iterator *******/ +/******** double chained lists with builtin iterator *******/ typedef struct xine_node_s { struct xine_node_s *next, *prev; void *content; + + int priority; } xine_node_t; @@ -840,6 +842,11 @@ void *xine_list_last_content (xine_list_t *l); */ void *xine_list_prev_content (xine_list_t *l); +/** + * Append content to list, sorted by decreasing priority. + */ +void xine_list_append_priority_content (xine_list_t *l, void *content, int priority); + /** * Append content to list. */ -- cgit v1.2.3