I propose that AV_PIX_FMT_NONE is changed from -1 to 0. The reason is
that default-initializing an AVPixelFormat should set an invalid or
neutral value, instead of a "random" valid value.

Currently, 0 means AV_PIX_FMT_YUV420P, which is confusing and can lead
to errors, especially since almost all video is yuv420p anyway.

The only problem I see with this is that some code does "<0" to check
for an "unset" format. Some code even uses "-1" instead of the enum
constants, like avcodec_parameters_alloc(). This code would have to be
changed. (You could consider it "buggy" because it didn't use the enum
constant and hardcoded the exact integer values, even though that was
not documented as allowed.)

The same applies to AV_SAMPLE_FMT_NONE (which currently is -1).
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to