On Tue, Mar 28, 2017 at 12:43 PM, wm4 <nfx...@googlemail.com> wrote: > 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.
I wouldn't be against this idea, I actually think it makes sense. > 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.) I believe some initialization functions would need changes too, but I don't know which ones off hand. -- Vittorio _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel