Gyan Doshi: > > > On 31-01-2020 10:41 pm, Andreas Rheinhardt wrote: >> Gyan Doshi: >>> Allows selecting demuxer by extension which are more widely recognized >>> by users. >>> >>> Conditional cast added since this function will usually be called >>> after >>> av_find_input_format, and so matches its return type. >> That's not a good point. av_demuxer_find_by_ext() already always >> returns const AVInputFormat *, so you casting the const away when >> returning is pointless. Furthermore, any caller that wants to use this >> new function can simply use a pointer to const AVInputFormat to work >> with both av_find_input_format() and av_demuxer_find_by_ext(). And >> after all, adding const makes the code more future-proof >> (av_find_input_format() will return const AVInputFormat * after the >> next major bump). > > Ok, I don't think I should add const to the pointers at the receiving > end (fftools) since they are global variables and may not be > acceptable as const. So I'll cast away the const when receiving and > remove the conditional cast. > > Sounds fine? >
Given that a user would have to cast the const away for avformat_open_input() if he worked with pointers to const AVInputFormat I don't want to block your patch because of const-correctness. So proceed as you wish. - Andreas _______________________________________________ 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".