changeset 4629:2faa1399dd68 libavcodec

add av_opt_set_defaults2() which sets just defaults from AVOptions whos flags match a user specified & mask = flags
author michael
date Wed, 07 Mar 2007 02:21:35 +0000
parents b0016ed89048
children 1416371d4a6c
files opt.c opt.h
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/opt.c	Wed Mar 07 02:03:44 2007 +0000
+++ b/opt.c	Wed Mar 07 02:21:35 2007 +0000
@@ -343,10 +343,12 @@
  *
  * @param s AVCodecContext or AVFormatContext for which the defaults will be set
  */
-void av_opt_set_defaults(void *s)
+void av_opt_set_defaults2(void *s, int mask, int flags)
 {
     const AVOption *opt = NULL;
     while ((opt = av_next_option(s, opt)) != NULL) {
+        if((opt->flags & mask) != flags)
+            continue;
         switch(opt->type) {
             case FF_OPT_TYPE_CONST:
                 /* Nothing to be done here */
@@ -379,3 +381,7 @@
     }
 }
 
+void av_opt_set_defaults(void *s){
+    av_opt_set_defaults2(s, 0, 0);
+}
+
--- a/opt.h	Wed Mar 07 02:03:44 2007 +0000
+++ b/opt.h	Wed Mar 07 02:21:35 2007 +0000
@@ -80,5 +80,6 @@
 const AVOption *av_next_option(void *obj, const AVOption *last);
 int av_opt_show(void *obj, void *av_log_obj);
 void av_opt_set_defaults(void *s);
+void av_opt_set_defaults2(void *s, int mask, int flags);
 
 #endif