On Sun, Dec 25, 2016 at 11:44:07AM +0100, Nicolas George wrote:
> 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);

yes, something like that (or a av_assert1(ret != AVERROR_OUT_OF_FUEL)


> 
> 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.

its premature too but if we have expensive checks we could cache the
result in the link


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship: All citizens are under surveillance, all their steps and
actions recorded, for the politicians to enforce control.
Democracy: All politicians are under surveillance, all their steps and
actions recorded, for the citizens to enforce control.

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