fftools/ffmpeg_filter: check the codec's descriptor to see if it's lossless
authorJames Almer <jamrial@gmail.com>
Mon, 18 May 2020 15:38:35 +0000 (12:38 -0300)
committerJames Almer <jamrial@gmail.com>
Thu, 21 May 2020 15:32:15 +0000 (12:32 -0300)
Signed-off-by: James Almer <jamrial@gmail.com>
fftools/ffmpeg_filter.c

index 8b5b157..422e126 100644 (file)
@@ -99,7 +99,8 @@ void choose_sample_fmt(AVStream *st, AVCodec *codec)
                 break;
         }
         if (*p == -1) {
-            if((codec->capabilities & AV_CODEC_CAP_LOSSLESS) && av_get_sample_fmt_name(st->codecpar->format) > av_get_sample_fmt_name(codec->sample_fmts[0]))
+            const AVCodecDescriptor *desc = avcodec_descriptor_get(codec->id);
+            if(desc && (desc->props & AV_CODEC_PROP_LOSSLESS) && av_get_sample_fmt_name(st->codecpar->format) > av_get_sample_fmt_name(codec->sample_fmts[0]))
                 av_log(NULL, AV_LOG_ERROR, "Conversion will not be lossless.\n");
             if(av_get_sample_fmt_name(st->codecpar->format))
             av_log(NULL, AV_LOG_WARNING,