You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/evc_parse: make freeing EVCParserContext buffers a shared function
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -765,3 +765,10 @@ int ff_evc_parse_nal_unit(EVCParserContext *ctx, const uint8_t *buf, int buf_siz
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ff_evc_parse_free(EVCParserContext *ctx) {
|
||||||
|
for (int i = 0; i < EVC_MAX_SPS_COUNT; i++)
|
||||||
|
av_freep(&ctx->sps[i]);
|
||||||
|
|
||||||
|
for (int i = 0; i < EVC_MAX_PPS_COUNT; i++)
|
||||||
|
av_freep(&ctx->pps[i]);
|
||||||
|
}
|
||||||
|
@@ -350,4 +350,6 @@ EVCParserPPS *ff_evc_parse_pps(EVCParserContext *ctx, const uint8_t *bs, int bs_
|
|||||||
|
|
||||||
int ff_evc_parse_nal_unit(EVCParserContext *ctx, const uint8_t *buf, int buf_size, void *logctx);
|
int ff_evc_parse_nal_unit(EVCParserContext *ctx, const uint8_t *buf, int buf_size, void *logctx);
|
||||||
|
|
||||||
|
void ff_evc_parse_free(EVCParserContext *ctx);
|
||||||
|
|
||||||
#endif /* AVCODEC_EVC_PARSE_H */
|
#endif /* AVCODEC_EVC_PARSE_H */
|
||||||
|
@@ -202,16 +202,7 @@ static void evc_parser_close(AVCodecParserContext *s)
|
|||||||
{
|
{
|
||||||
EVCParserContext *ctx = s->priv_data;
|
EVCParserContext *ctx = s->priv_data;
|
||||||
|
|
||||||
for(int i = 0; i < EVC_MAX_SPS_COUNT; i++) {
|
ff_evc_parse_free(ctx);
|
||||||
EVCParserSPS *sps = ctx->sps[i];
|
|
||||||
av_freep(&sps);
|
|
||||||
}
|
|
||||||
|
|
||||||
for(int i = 0; i < EVC_MAX_PPS_COUNT; i++) {
|
|
||||||
EVCParserPPS *pps = ctx->pps[i];
|
|
||||||
|
|
||||||
av_freep(&pps);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const AVCodecParser ff_evc_parser = {
|
const AVCodecParser ff_evc_parser = {
|
||||||
|
Reference in New Issue
Block a user