summaryrefslogtreecommitdiff
path: root/cmdutils.c
diff options
context:
space:
mode:
authorAnssi Hannula <anssi.hannula@iki.fi>2011-01-02 16:00:47 +0000
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2011-01-02 16:00:47 +0000
commitef2b2243dc1e258e77dac6d702d3c1ec1b2bcc6f (patch)
treef869e6ea83add24ff4fd7ed1fd93592a13fe579b /cmdutils.c
parent815495f0405d929b522ff948584ecd1de3662487 (diff)
Use AVOption for muxers in ffmpeg.
Patch by Anssi Hannula, anssi d hannula d iki d fi Originally committed as revision 26199 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'cmdutils.c')
-rw-r--r--cmdutils.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/cmdutils.c b/cmdutils.c
index 5e4b716891..a48d0c35c9 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -241,12 +241,20 @@ int opt_default(const char *opt, const char *arg){
}
if (!o) {
AVCodec *p = NULL;
+ AVOutputFormat *oformat = NULL;
while ((p=av_codec_next(p))){
AVClass *c= p->priv_class;
if(c && av_find_opt(&c, opt, NULL, 0, 0))
break;
}
- if(!p){
+ if (!p) {
+ while ((oformat = av_oformat_next(oformat))) {
+ const AVClass *c = oformat->priv_class;
+ if (c && av_find_opt(&c, opt, NULL, 0, 0))
+ break;
+ }
+ }
+ if(!p && !oformat){
fprintf(stderr, "Unrecognized option '%s'\n", opt);
exit(1);
}
@@ -322,7 +330,13 @@ void set_context_opts(void *ctx, void *opts_ctx, int flags, AVCodec *codec)
if(codec && codec->priv_class && avctx->priv_data){
priv_ctx= avctx->priv_data;
}
+ } else if (!strcmp("AVFormatContext", (*(AVClass**)ctx)->class_name)) {
+ AVFormatContext *avctx = ctx;
+ if (avctx->oformat && avctx->oformat->priv_class) {
+ priv_ctx = avctx->priv_data;
+ }
}
+
for(i=0; i<opt_name_count; i++){
char buf[256];
const AVOption *opt;