diff options
author | James Almer <jamrial@gmail.com> | 2023-06-20 10:40:58 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2023-06-21 13:31:14 -0300 |
commit | 2212808a72e6a9789836cfc4e9ed89f45291595e (patch) | |
tree | b9392ff01739181b2a15bb0691658979ba4bfbff /libavcodec/evc_parser.c | |
parent | d0d20f16ce4de0d814b7dac28fa18c666b7a8a85 (diff) |
avcodec/evc_ps: pass a GetBitContext to the SPS and PPS parsing functions
This is in preparation for the following patch.
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/evc_parser.c')
-rw-r--r-- | libavcodec/evc_parser.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libavcodec/evc_parser.c b/libavcodec/evc_parser.c index 5c8fcc5970..8dd6b5fda7 100644 --- a/libavcodec/evc_parser.c +++ b/libavcodec/evc_parser.c @@ -62,6 +62,7 @@ static int parse_nal_unit(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t *buf, int buf_size) { EVCParserContext *ctx = s->priv_data; + GetBitContext gb; int nalu_type, tid; int ret; @@ -89,14 +90,20 @@ static int parse_nal_unit(AVCodecParserContext *s, AVCodecContext *avctx, switch (nalu_type) { case EVC_SPS_NUT: - ret = ff_evc_parse_sps(&ctx->ps, buf, buf_size); + ret = init_get_bits8(&gb, buf, buf_size); + if (ret < 0) + return ret; + ret = ff_evc_parse_sps(&gb, &ctx->ps); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "SPS parsing error\n"); return ret; } break; case EVC_PPS_NUT: - ret = ff_evc_parse_pps(&ctx->ps, buf, buf_size); + ret = init_get_bits8(&gb, buf, buf_size); + if (ret < 0) + return ret; + ret = ff_evc_parse_pps(&gb, &ctx->ps); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "PPS parsing error\n"); return ret; |