diff mbox

[FFmpeg-devel] libavcodec/amfenc_hevc.c: Fix Profile level option on AMF HEVC.

Message ID 20191114171841.9492-1-ovchinnikov.dmitrii@gmail.com
State Accepted
Headers show

Commit Message

Dmitrii Ovchinnikov Nov. 14, 2019, 5:18 p.m. UTC
Patch proposed by Sitan Liu <nst799610810@gmail.com>

---
 libavcodec/amfenc_hevc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/libavcodec/amfenc_hevc.c b/libavcodec/amfenc_hevc.c
index 7c9a33ab33..a9ccab168c 100644
--- a/libavcodec/amfenc_hevc.c
+++ b/libavcodec/amfenc_hevc.c
@@ -136,7 +136,7 @@  static av_cold int amf_encode_init_hevc(AVCodecContext *avctx)
     AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_TIER, ctx->tier);
 
     profile_level = avctx->level;
-    if (profile_level == 0) {
+    if (profile_level == FF_LEVEL_UNKNOWN) {
         profile_level = ctx->level;
     }
     if (profile_level != 0) {
@@ -144,7 +144,7 @@  static av_cold int amf_encode_init_hevc(AVCodecContext *avctx)
     }
     AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET, ctx->quality);
     // Maximum Reference Frames
-    if (avctx->refs != 0) {
+    if (avctx->refs != -1) {
         AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_MAX_NUM_REFRAMES, avctx->refs);
     }
     // Aspect Ratio