diff codec-cfg.c @ 5325:9c326f199060

tagging selected codec to avoid trying the same codec several times
author arpi
date Mon, 25 Mar 2002 03:02:57 +0000
parents 0a58c2ef1da1
children 0b024f661dd0
line wrap: on
line diff
--- a/codec-cfg.c	Mon Mar 25 02:39:58 2002 +0000
+++ b/codec-cfg.c	Mon Mar 25 03:02:57 2002 +0000
@@ -702,6 +702,7 @@
 				if (c->fourcc[j]==fourcc || c->driver==0) {
 					if (fourccmap)
 						*fourccmap = c->fourccmap[j];
+					c->flags|=CODECS_FLAG_SELECTED;
 					return c;
 				}
 			}
@@ -710,6 +711,21 @@
 	return NULL;
 }
 
+void codecs_reset_selection(int audioflag){
+	int i;
+	codecs_t *c;
+	if (audioflag) {
+		i = nr_acodecs;
+		c = audio_codecs;
+	} else {
+		i = nr_vcodecs;
+		c = video_codecs;
+	}
+	if(i)
+	for (/* NOTHING */; i--; c++)
+		c->flags&=(~CODECS_FLAG_SELECTED);
+}
+
 void list_codecs(int audioflag){
 	int i;
 	codecs_t *c;