From f1533979a22834c29f71107a8460fb936782b5fe Mon Sep 17 00:00:00 2001 From: James Almer Date: Sun, 2 Apr 2017 00:16:02 -0300 Subject: [PATCH] avcodec/hevc_parse: allow setting apply_defdispwin when decoding SPS NAL units Reviewed-by: nevcairiel Signed-off-by: James Almer --- libavcodec/hevc_parse.c | 12 ++++++------ libavcodec/hevc_parse.h | 4 ++-- libavcodec/mediacodecdec.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libavcodec/hevc_parse.c b/libavcodec/hevc_parse.c index 25c44fd95d..ee4cd54d3e 100644 --- a/libavcodec/hevc_parse.c +++ b/libavcodec/hevc_parse.c @@ -23,7 +23,7 @@ static int hevc_decode_nal_units(const uint8_t *buf, int buf_size, HEVCParamSets *ps, int is_nalff, int nal_length_size, int err_recognition, - void *logctx) + int apply_defdispwin, void *logctx) { int i; int ret = 0; @@ -45,7 +45,7 @@ static int hevc_decode_nal_units(const uint8_t *buf, int buf_size, HEVCParamSets goto done; break; case HEVC_NAL_SPS: - ret = ff_hevc_decode_nal_sps(&nal->gb, logctx, ps, 1); + ret = ff_hevc_decode_nal_sps(&nal->gb, logctx, ps, apply_defdispwin); if (ret < 0) goto done; break; @@ -69,8 +69,8 @@ done: } int ff_hevc_decode_extradata(const uint8_t *data, int size, HEVCParamSets *ps, - int *is_nalff, int *nal_length_size, - int err_recognition, void *logctx) + int *is_nalff, int *nal_length_size, int err_recognition, + int apply_defdispwin, void *logctx) { int ret = 0; GetByteContext gb; @@ -109,7 +109,7 @@ int ff_hevc_decode_extradata(const uint8_t *data, int size, HEVCParamSets *ps, } ret = hevc_decode_nal_units(gb.buffer, nalsize, ps, *is_nalff, *nal_length_size, - err_recognition, logctx); + err_recognition, apply_defdispwin, logctx); if (ret < 0) { av_log(logctx, AV_LOG_ERROR, "Decoding nal unit %d %d from hvcC failed\n", @@ -126,7 +126,7 @@ int ff_hevc_decode_extradata(const uint8_t *data, int size, HEVCParamSets *ps, } else { *is_nalff = 0; ret = hevc_decode_nal_units(data, size, ps, *is_nalff, *nal_length_size, - err_recognition, logctx); + err_recognition, apply_defdispwin, logctx); if (ret < 0) return ret; } diff --git a/libavcodec/hevc_parse.h b/libavcodec/hevc_parse.h index 39bd23e6ea..8aa46a290a 100644 --- a/libavcodec/hevc_parse.h +++ b/libavcodec/hevc_parse.h @@ -27,7 +27,7 @@ #include "hevcdec.h" int ff_hevc_decode_extradata(const uint8_t *data, int size, HEVCParamSets *ps, - int *is_nalff, int *nal_length_size, - int err_recognition, void *logctx); + int *is_nalff, int *nal_length_size, int err_recognition, + int apply_defdispwin, void *logctx); #endif /* AVCODEC_HEVC_PARSE_H */ diff --git a/libavcodec/mediacodecdec.c b/libavcodec/mediacodecdec.c index 857e7a5fed..6fd0db2fa5 100644 --- a/libavcodec/mediacodecdec.c +++ b/libavcodec/mediacodecdec.c @@ -202,7 +202,7 @@ static int hevc_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format) memset(&ps, 0, sizeof(ps)); ret = ff_hevc_decode_extradata(avctx->extradata, avctx->extradata_size, - &ps, &is_nalff, &nal_length_size, 0, avctx); + &ps, &is_nalff, &nal_length_size, 0, 1, avctx); if (ret < 0) { goto done; }