On 09/30/2012 12:38 AM, Georgi Chorbadzhiyski wrote:
> On 9/30/12 12:07 AM, Luca Barbato wrote:
>> + if (s->oformat->init) {
>> + ret = s->oformat->init(s);
>> + if (ret < 0)
>> + return ret;
>> + }
>
> This construct seems to be used in a lot of places, may be
> some define would clean up the code.
>
> #define call_op(ctx, ops, func) \
> do { \
> if (ctx->ops->func) { \
> ret = ctx->ops->func(ctx); \
> if (ret < 0) \
> return ret; \
> } \
> } while(0)
>
> call_op(s, oformat, init);
Not sure if it could bite us later, I prefer being explicit in those
situations.
lu
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel