aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/options.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-06-08 08:27:53 +0200
committerAnton Khirnov <anton@khirnov.net>2011-07-10 17:10:49 +0200
commit84626b364babc27c5a3db454ebf6a02aeaa186fe (patch)
tree686ab526ca0ac930bc7bbcc0e4bb81591a83a0bf /libavcodec/options.c
parent71a861cf4010ab835fab383a250f27903eb61a34 (diff)
downloadffmpeg-84626b364babc27c5a3db454ebf6a02aeaa186fe.tar.gz
lavc: add support for codec-specific defaults.
Diffstat (limited to 'libavcodec/options.c')
-rw-r--r--libavcodec/options.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/options.c b/libavcodec/options.c
index 1e7fe522ea..4869046665 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -25,6 +25,8 @@
*/
#include "avcodec.h"
+#include "internal.h"
+#include "libavutil/avassert.h"
#include "libavutil/opt.h"
#include <float.h> /* FLT_MIN, FLT_MAX */
@@ -524,6 +526,15 @@ int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec){
av_opt_set_defaults(s->priv_data);
}
}
+ if (codec && codec->defaults) {
+ int ret;
+ AVCodecDefault *d = codec->defaults;
+ while (d->key) {
+ ret = av_set_string3(s, d->key, d->value, 0, NULL);
+ av_assert0(ret >= 0);
+ d++;
+ }
+ }
return 0;
}