diff --git a/src/h264decoder.cpp b/src/h264decoder.cpp index c4083c9..dc49c3a 100644 --- a/src/h264decoder.cpp +++ b/src/h264decoder.cpp @@ -34,10 +34,12 @@ H264Decoder::H264Decoder() if (!context) throw H264InitFailure("cannot allocate context"); +#if LIBAVCODEC_VERSION_MAJOR < 60 // Note: CODEC_CAP_TRUNCATED was prefixed with AV_... if(codec->capabilities & AV_CODEC_CAP_TRUNCATED) { context->flags |= AV_CODEC_FLAG_TRUNCATED; - } + } +#endif int err = avcodec_open2(context, codec, nullptr); if (err < 0) @@ -169,4 +171,4 @@ int row_size(const AVFrame& f) void disable_logging() { av_log_set_level(AV_LOG_QUIET); -} \ No newline at end of file +}