# HG changeset patch # User michael # Date 1255696549 0 # Node ID db144278f2881747a3dfb1441fa7a6bcc00eae9e # Parent 2d076fd5f927dfa37c041464950507b728fd27e1 Very evil missuse of svn to test if AVOption and AVOption2 are compatible. If this test triggers anywhere for anyone, revert this commit immedeatly. Ill revert this in a day or 2, its just so we know beforehand if the idea with the union is doable or not without breaking ABI/API. diff -r 2d076fd5f927 -r db144278f288 opt.c --- a/opt.c Fri Oct 16 12:31:32 2009 +0000 +++ b/opt.c Fri Oct 16 12:35:49 2009 +0000 @@ -408,6 +408,19 @@ void av_opt_set_defaults2(void *s, int mask, int flags) { const AVOption *opt = NULL; + + if( sizeof(AVOption) != sizeof(AVOption2) + || offsetof(AVOption,default_val) != offsetof(AVOption2,default_val.dbl) + || offsetof(AVOption,min) != offsetof(AVOption2,min) + ){ + av_log(NULL, AV_LOG_ERROR, "AVOpt1/2 missmatch %zd %zd %td %td %td %td\n", + sizeof(AVOption), sizeof(AVOption2), + offsetof(AVOption,default_val), offsetof(AVOption2,default_val.dbl), + offsetof(AVOption,min), offsetof(AVOption2,min)); +#undef exit + exit(123); + } + while ((opt = av_next_option(s, opt)) != NULL) { if((opt->flags & mask) != flags) continue;