Tomas Härdin (12019-12-09):
> As far as I can tell this is OK, and it passes FATE. But it just looks
> very very wrong. Why does this function even exist if all it
> effectively does is return the integers from 0..count-1?

For some time, there were gaps in the list of pixel formats, the task of
this function was precisely there to avoid the gaps and keep only the
actual pixel formats.

I am not sure about this change. It is technically valid, but it may
cause problems later.

There is an intermediate solution: keep the loop, but allocate only
once (simplified):

        while ((desc = ...))
            count++;
        ret->formats = av_malloc_array(count, sizeof(*ret->formats));
        count = 0;
        while ((desc = ...))
            ret->formats[count] = ...;

What do other developers think about it, with these explanations?

Regards,

-- 
  Nicolas George

Attachment: signature.asc
Description: PGP signature

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to