aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2020-05-18 12:38:35 -0300
committerJames Almer <jamrial@gmail.com>2020-05-21 12:32:15 -0300
commit0a3ba58b444fb8bcc53a532cf2524a3088a6ce0a (patch)
treedcd6b1231281bb8e4a73bb12ddfb422aee0fd5da
parentd3bedba97fcbc395d61c509ab41da4fec498db2b (diff)
downloadffmpeg-0a3ba58b444fb8bcc53a532cf2524a3088a6ce0a.tar.gz
fftools/ffmpeg_filter: check the codec's descriptor to see if it's lossless
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--fftools/ffmpeg_filter.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 8b5b157be7..422e1268e9 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -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,