changeset 3408:725b3de963eb

enabled validate_codec with some restrictions
author alex
date Sun, 09 Dec 2001 18:25:09 +0000
parents b33d04167063
children b26e0f8cf2d7
files codec-cfg.c
diffstat 1 files changed, 15 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/codec-cfg.c	Sun Dec 09 18:04:17 2001 +0000
+++ b/codec-cfg.c	Sun Dec 09 18:25:09 2001 +0000
@@ -243,26 +243,34 @@
 
 static int validate_codec(codecs_t *c, int type)
 {
-#if 0
 	int i;
+	char *tmp_name = strdup(c->name);
 
-	for (i = 0; i < strlen(c->name) && isalnum(c->name[i]); i++)
+	for (i = 0; i < strlen(tmp_name) && isalnum(tmp_name[i]); i++)
 		/* NOTHING */;
-	if (i < strlen(c->name)) {
-		printf("\ncodec(%s)->name is not valid!\n", c->name);
+
+	if (i < strlen(tmp_name)) {
+		printf("\ncodec(%s) name is not valid!\n", c->name);
 		return 0;
 	}
-#warning codec->info = codec->name; ez ok, vagy strdup()?
+
 	if (!c->info)
-		c->info = c->name;
+		c->info = strdup(c->name);
+
+#if 0
 	if (c->fourcc[0] == 0xffffffff) {
 		printf("\ncodec(%s) does not have fourcc/format!\n", c->name);
 		return 0;
 	}
+
+	/* XXX fix this: shitty with 'null' codec */
 	if (!c->driver) {
 		printf("\ncodec(%s) does not have a driver!\n", c->name);
 		return 0;
 	}
+#endif
+
+#if 0
 #warning codec->driver == 4;... <- ezt nem kellene belehegeszteni...
 #warning HOL VANNAK DEFINIALVA????????????
 	if (!c->dll && (c->driver == 4 ||
@@ -595,7 +603,7 @@
 	free(fp);
 	return NULL;
 err_out_not_valid:
-	printf("codec is not definied correctly");
+	printf("codec is not defined correctly");
 	goto err_out_print_linenum;
 }