comparison opt.c @ 10364:917c88a80b67 libavcodec

Revert: r18826 | stefano | 2009-05-14 20:50:58 +0200 (Thu, 14 May 2009) | 2 lines Make av_set_string3() print a message in case of unknown option. This change led to multiple identical error messages to be printed if an option was not found.
author michael
date Mon, 05 Oct 2009 20:18:16 +0000
parents 04d77f7cc7fd
children db144278f288
comparison
equal deleted inserted replaced
10363:08573f5f587d 10364:917c88a80b67
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);
117 return AVERROR(ENOENT); 116 return AVERROR(ENOENT);
118 }
119 if(!val || o->offset<=0) 117 if(!val || o->offset<=0)
120 return AVERROR(EINVAL); 118 return AVERROR(EINVAL);
121 119
122 if(o->type == FF_OPT_TYPE_BINARY){ 120 if(o->type == FF_OPT_TYPE_BINARY){
123 uint8_t **dst = (uint8_t **)(((uint8_t*)obj) + o->offset); 121 uint8_t **dst = (uint8_t **)(((uint8_t*)obj) + o->offset);