On Tue, Jun 22, 2021 at 12:14:12PM +0200, Hendrik Leppkes wrote: > On Tue, Jun 22, 2021 at 12:12 PM <lance.lmw...@gmail.com> wrote: > > > > From: Limin Wang <lance.lmw...@gmail.com> > > > > Signed-off-by: Limin Wang <lance.lmw...@gmail.com> > > --- > > have tested with x264 version 141, 142, 156, 157, 163, 164. > > > > libavcodec/libx264.c | 15 ++++++++++++++- > > 1 file changed, 14 insertions(+), 1 deletion(-) > > > > diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c > > index 36fdb56..977b78a 100644 > > --- a/libavcodec/libx264.c > > +++ b/libavcodec/libx264.c > > @@ -749,6 +749,19 @@ static av_cold int X264_init(AVCodecContext *avctx) > > av_log(avctx, AV_LOG_ERROR, > > "x264 too old for AVC Intra, at least version 142 > > needed\n"); > > #endif > > + > > + if (x4->avcintra_class > 200) { > > +#if X264_BUILD < 164 > > + av_log(avctx, AV_LOG_ERROR, > > + "x264 too old for AVC Intra 300/480, at least version 164 > > needed\n"); > > + return AVERROR(EINVAL); > > +#endif > > +#if X264_BUILD >= 157 > > + /* AVC-Intra 300/480 only supported by Sony XAVC flavor */ > > + x4->params.i_avcintra_flavor = X264_AVCINTRA_FLAVOR_SONY; > > +#endif > > + } > > + > > It feels odd to have different versions being checked here. If its < > 164 the second part is always dead code, so why not just put it into > an #else of the same check?
you're right, it'll be more simple. will change to else instead of checking for 157. > > - Hendrik > _______________________________________________ > 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". -- Thanks, Limin Wang _______________________________________________ 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".