Mercurial > libavcodec.hg
comparison opt.c @ 9641:04d77f7cc7fd libavcodec
Make av_set_string3() print a message in case of unknown option.
| author | stefano |
|---|---|
| date | Thu, 14 May 2009 18:50:58 +0000 |
| parents | 854368240f7d |
| children | 917c88a80b67 |
comparison
equal
deleted
inserted
replaced
| 9640:854368240f7d | 9641:04d77f7cc7fd |
|---|---|
| 110 int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out){ | 110 int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out){ |
| 111 int ret; | 111 int ret; |
| 112 const AVOption *o= av_find_opt(obj, name, NULL, 0, 0); | 112 const AVOption *o= av_find_opt(obj, name, NULL, 0, 0); |
| 113 if (o_out) | 113 if (o_out) |
| 114 *o_out = o; | 114 *o_out = o; |
| 115 if(!o) | 115 if(!o) { |
| 116 av_log(obj, AV_LOG_ERROR, "Unknown option '%s'\n", name); | |
| 116 return AVERROR(ENOENT); | 117 return AVERROR(ENOENT); |
| 118 } | |
| 117 if(!val || o->offset<=0) | 119 if(!val || o->offset<=0) |
| 118 return AVERROR(EINVAL); | 120 return AVERROR(EINVAL); |
| 119 | 121 |
| 120 if(o->type == FF_OPT_TYPE_BINARY){ | 122 if(o->type == FF_OPT_TYPE_BINARY){ |
| 121 uint8_t **dst = (uint8_t **)(((uint8_t*)obj) + o->offset); | 123 uint8_t **dst = (uint8_t **)(((uint8_t*)obj) + o->offset); |
