Mercurial > libavcodec.hg
comparison opt.c @ 10423:2e4967487e59 libavcodec
Revert r20249, it seems the union trick works everywhere
Original commit message:
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.
author | michael |
---|---|
date | Sat, 17 Oct 2009 19:35:47 +0000 |
parents | db144278f288 |
children | 5ab861519e79 |
comparison
equal
deleted
inserted
replaced
10422:1c33160b0722 | 10423:2e4967487e59 |
---|---|
406 * @param s AVCodecContext or AVFormatContext for which the defaults will be set | 406 * @param s AVCodecContext or AVFormatContext for which the defaults will be set |
407 */ | 407 */ |
408 void av_opt_set_defaults2(void *s, int mask, int flags) | 408 void av_opt_set_defaults2(void *s, int mask, int flags) |
409 { | 409 { |
410 const AVOption *opt = NULL; | 410 const AVOption *opt = NULL; |
411 | |
412 if( sizeof(AVOption) != sizeof(AVOption2) | |
413 || offsetof(AVOption,default_val) != offsetof(AVOption2,default_val.dbl) | |
414 || offsetof(AVOption,min) != offsetof(AVOption2,min) | |
415 ){ | |
416 av_log(NULL, AV_LOG_ERROR, "AVOpt1/2 missmatch %zd %zd %td %td %td %td\n", | |
417 sizeof(AVOption), sizeof(AVOption2), | |
418 offsetof(AVOption,default_val), offsetof(AVOption2,default_val.dbl), | |
419 offsetof(AVOption,min), offsetof(AVOption2,min)); | |
420 #undef exit | |
421 exit(123); | |
422 } | |
423 | |
424 while ((opt = av_next_option(s, opt)) != NULL) { | 411 while ((opt = av_next_option(s, opt)) != NULL) { |
425 if((opt->flags & mask) != flags) | 412 if((opt->flags & mask) != flags) |
426 continue; | 413 continue; |
427 switch(opt->type) { | 414 switch(opt->type) { |
428 case FF_OPT_TYPE_CONST: | 415 case FF_OPT_TYPE_CONST: |