diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-08-11 11:44:51 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-08-11 11:44:51 +0000 |
commit | 84c038696097e5d4951ba3ad180e1100d66c0947 (patch) | |
tree | 7fec9365ce84f2dfd64e287b38bb48eda0c41b1e /libavfilter/avfilter.c | |
parent | ad0d70c964f852a18e9ab8124f0e7aa8876cac6e (diff) | |
download | ffmpeg-84c038696097e5d4951ba3ad180e1100d66c0947.tar.gz |
Change avfilter_open() signature, from:
AVFilterContext *avfilter_open(AVFilter *filter, const char *inst_name);
to:
int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name);
This way it is possible to propagate an error code telling the reason
of the failure.
Originally committed as revision 24765 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r-- | libavfilter/avfilter.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index b4e1c20023..e31aeac3d8 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -394,12 +394,13 @@ static const AVClass avfilter_class = { LIBAVUTIL_VERSION_INT, }; -AVFilterContext *avfilter_open(AVFilter *filter, const char *inst_name) +int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name) { AVFilterContext *ret; + *filter_ctx = NULL; if (!filter) - return 0; + return AVERROR(EINVAL); ret = av_mallocz(sizeof(AVFilterContext)); @@ -422,7 +423,8 @@ AVFilterContext *avfilter_open(AVFilter *filter, const char *inst_name) ret->outputs = av_mallocz(sizeof(AVFilterLink*) * ret->output_count); } - return ret; + *filter_ctx = ret; + return 0; } void avfilter_destroy(AVFilterContext *filter) |