[FFmpeg-devel] [PATCH 3/3] lavd/v4l2: simplify return value checks

Paul B Mahol onemda at gmail.com
Wed Jan 16 11:09:50 CET 2013


On 1/16/13, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> Stephan Hilb <stephan <at> ecshi.net> writes:
>
>> >> -    fd = v4l2_open(ctx->filename, flags, 0);
>> >> -    if (fd < 0) {
>> >> +    if ((fd = v4l2_open(ctx->filename, flags, 0)) < 0) {
>> >
>> > I fear one could say that it was decided yesterday that
>> > such changes are not welcome;-(
>>
>> Alright, must've missed that. Is this a general rule?
>
> No, just the opinion of one developer:
> http://thread.gmane.org/gmane.comp.video.ffmpeg.cvs/59578/focus=59590

I prefer to write opposite of that one developer opinion when writing new
code and I try hard to make such cases correct. But I dislike changing
already existent code just for some questionable cosmetics sake.

Conclustion:
Both variants are OK in new code (if they are correct).
Changing existent code just for itself is not good. Instead
spend your time on something more useful.


More information about the ffmpeg-devel mailing list