[MPlayer-dev-eng] codecs.conf versioning

Joey Parrish joey at yunamusic.com
Mon May 20 20:55:14 CEST 2002


Hello, 

On Mon, May 20, 2002 at 03:30:18AM +0200, Arpi wrote:
> Hi,
> 
> What about adding a version number to the codecs.conf file, and check
> for this number in mplayer at the startup?
> it shouldn't require up-to-minute codecs.conf, but we could increase the
> version number at incompatible changes (when the new version is REQUIRED
> to work)
> 
> something like:
> version 123
> should be ok, right?

> the only question is: what numbering sheme to be used?
> we could use a counter, starting from 1 and increasing every time when
> a big change is done, or use something like mplayer version number +
> subversion? like 0.90-3 ? later may look better but hard to parse and handle.

What about a format like YYYYMMDD for the sake of CVS versions?
That would be easy to parse and could be handled as an int somewhere.

I've made a patch (attached below) that will parse that out of codecs.conf, 
but I'm not sure where the best place is to store/check that number.
In my patch, the line "release YYYYMMDD" is found and the release 
number is only printed to stdout but not stored.

I'm looking for suggestions for where to store the release number as 
taken from codecs.conf, where to store the minimum release number that 
mplayer requires (#define?), and where/when to compare these two.

Thanks,
--Joey

-- 

"Yes." -- John F. Kennedy
-------------- next part --------------
--- codec-cfg.c.orig	Mon May 20 12:41:48 2002
+++ codec-cfg.c	Mon May 20 13:46:24 2002
@@ -468,13 +468,28 @@
 	}
 
 	/*
-	 * check if the cfgfile starts with 'audiocodec' or
-	 * with 'videocodec'
+	 * this only catches release lines at the start of 
+	 * codecs.conf, before audiocodecs and videocodecs.
+	 * should this be changed?
 	 */
 	while ((tmp = get_token(1, 1)) == RET_EOL)
 		/* NOTHING */;
 	if (tmp == RET_EOF)
 		goto out;
+	if (!strcmp(token[0], "release")) {
+		if (get_token(1, 2) < 0)
+			goto err_out_parse_error;
+		/* FIXME: how should this be used? */
+		printf("codecs.conf release %s\n\n", token[0]);
+		while ((tmp = get_token(1, 1)) == RET_EOL)
+			/* NOTHING */;
+		if (tmp == RET_EOF)
+			goto out;
+	}
+	/*
+	 * check if the cfgfile starts with 'audiocodec' or
+	 * with 'videocodec'
+	 */
 	if (!strcmp(token[0], "audiocodec") || !strcmp(token[0], "videocodec"))
 		goto loop_enter;
 	goto err_out_parse_error;
--- etc/codecs.conf.orig	Thu May 16 18:23:16 2002
+++ etc/codecs.conf	Mon May 20 13:46:55 2002
@@ -3,6 +3,8 @@
 ;  Before editing this file, please read DOCS/tech/codecs.conf.txt !
 ;=============================================================================
 
+release 20020520
+
 ;=============================================================================
 ;                   VIDEO CODECS
 ;=============================================================================


More information about the MPlayer-dev-eng mailing list