[MPlayer-dev-eng] [PATCH] Support CineForm HD

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri May 21 19:34:36 CEST 2010


On Fri, May 21, 2010 at 10:31:49AM +0200, Steinar H. Gunderson wrote:
> On Fri, May 21, 2010 at 09:38:09AM +0200, Diego Biurrun wrote:
> >> No; I gave up getting the rest of the patch set into mainline.
> > Why?
> 
> It wasn't worth it trying to redesign the registry subsystem after arbitrary
> demands to get two default values in for one codec.

That wasn't how I meant it.
I suggested different ways that e.g. might work better in the long term (because
that kind of special cases just doesn't scale and isn't maintainable).
Personally, I would have considered something like below (untested) and requiring that users
delete their old registry file acceptable and more reliable/maintainable/...
However, only plugging the memleaks is non-optional.
Index: loader/registry.c
===================================================================
--- loader/registry.c	(revision 31188)
+++ loader/registry.c	(working copy)
@@ -66,7 +66,7 @@
 	save_registry();
 	return;
     }
-    regs=malloc(3*sizeof(struct reg_value));
+    regs=malloc(5*sizeof(struct reg_value));
     regs[0].type=regs[1].type=DIR;
     regs[0].name=malloc(5);
     strcpy(regs[0].name, "HKLM");
@@ -74,7 +74,18 @@
     strcpy(regs[1].name, "HKCU");
     regs[0].value=regs[1].value=NULL;
     regs[0].len=regs[1].len=0;
-    reg_size=2;
+    regs[2].type=REG_DWORD;
+    regs[2].name=strdup("HKCU\\SOFTWARE\\CineForm\\DecoderProperties\\Resolution");
+    regs[2].value=malloc(4);
+    *(uint32_t *)regs[2].value=0x1000;
+    regs[2].type=REG_DWORD;
+    regs[2].len=4;
+    regs[3].name=strdup("HKCU\\SOFTWARE\\CineForm\\DecoderProperties\\PixelFormats");
+    regs[3].value=malloc(4);
+    *(uint32_t *)regs[3].value=0xffff;
+    regs[3].len=4;
+
+    reg_size=4;
     head = 0;
     save_registry();
 }



More information about the MPlayer-dev-eng mailing list