On Tue, Dec 25, 2018 at 02:11:45PM +0100, Paul B Mahol wrote: > On 12/25/18, Michael Niedermayer <mich...@niedermayer.cc> wrote: > > On Mon, Dec 24, 2018 at 06:34:30PM +0100, Paul B Mahol wrote: > > [...] > >> -static const char *get_channel_name(int channel_id) > >> +const char *av_channel_name(enum AVChannel channel_id) > >> { > > > >> if (channel_id < 0 || channel_id >= FF_ARRAY_ELEMS(channel_names)) > >> return NULL; > >> + if ((unsigned) channel_id >= FF_ARRAY_ELEMS(channel_names)) > >> + return "?"; > > > > this looks like a untended duplicate check > > > > [...] > > > >> +/** > >> + * Check whether two channel layouts are semantically the same, i.e. the > >> same > >> + * channels are present on the same positions in both. > >> + * > >> + * If one of the channel layouts is AV_CHANNEL_ORDER_UNSPEC, while the > >> other is > >> + * not, they are considered to be unequal. If both are > >> AV_CHANNEL_ORDER_UNSPEC, > >> + * they are considered equal iff the channel counts are the same in > >> both. > >> + * > >> + * @param chl input channel layout > >> + * @param chl1 input channel layout > >> + * @return 0 if chl and chl1 are equal, 1 if they are not equal. A > >> negative > >> + * AVERROR code if one or both are invalid. > >> + */ > >> +int av_channel_layout_compare(const AVChannelLayout *chl, const > >> AVChannelLayout *chl1); > > > > It could be usefull if this is a full compare function that allows > > sorting/ordering > > Which kind of sorting?
it doesnt matter which sorting. Having some allows some operations to be performed more efficient than having none. An example is merging 2 lists removing duplicates. 2 sorted lists can be merged in O(n) but if theres no way to sort and just a equal / non equal check it requires O(n^2) > That could be only added later when needed. adding it later is fine but i think its better if the API allows it. This would not work with above as it requires "1 if they are not equal", it could allow 1 or -1 (or just non zero) then it can be extended thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Whats the most studid thing your enemy could do ? Blow himself up Whats the most studid thing you could do ? Give up your rights and freedom because your enemy blew himself up.
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel