Le quintidi 5 nivôse, an CCXXV, Michael Niedermayer a écrit :
> Whats your oppinion on using a explicit av_assert1() in the calling
> code for this ? (i assume it can be done easily&cleanly)
> 
> It would explicitly in C code say what is meant, while a
> "_sure" requires additional knowledge specific to lavfi

You mean, in the caller, instead of:

        ret = ff_link_consume_frame_sure(link, &frame);

write:

        ret = ff_link_consume_frame(link, &frame);
        av_assert1(ret >= 0);

Well, it loses us the property that ff_link_consume_frame_sure() cannot
fail at all (ff_link_consume_samples_sure() can, because it allocates
memory) and thus do not require getting the return value at all. But I
was not sure I wanted to make this a promise anyway.

Also, it adds extra tests: one in the code, one in consume() instead of
just one in the code (not counting the asserts, only present in debug
builds). But that is just my premature optimizer side talking.

Apart from that I am ok with it. It just requires documentation that
this is the recommended idiom.

Regards,

-- 
  Nicolas George

Attachment: signature.asc
Description: Digital signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to