mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
Merge commit '8229eff4b7a98ae5d85bb75f3bb072781b4a8ebe'
* commit '8229eff4b7a98ae5d85bb75f3bb072781b4a8ebe': h2645_parse: add a function for uninitializing the packet Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
This commit is contained in:
commit
8e73574d4f
@ -295,3 +295,13 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ff_h2645_packet_uninit(H2645Packet *pkt)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < pkt->nals_allocated; i++) {
|
||||
av_freep(&pkt->nals[i].rbsp_buffer);
|
||||
av_freep(&pkt->nals[i].skipped_bytes_pos);
|
||||
}
|
||||
av_freep(&pkt->nals);
|
||||
pkt->nals_allocated = 0;
|
||||
}
|
||||
|
@ -65,4 +65,9 @@ int ff_h2645_extract_rbsp(const uint8_t *src, int length,
|
||||
int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,
|
||||
AVCodecContext *avctx, int is_nalff, int nal_length_size);
|
||||
|
||||
/**
|
||||
* Free all the allocated memory in the packet.
|
||||
*/
|
||||
void ff_h2645_packet_uninit(H2645Packet *pkt);
|
||||
|
||||
#endif /* AVCODEC_H2645_PARSE_H */
|
||||
|
@ -3111,12 +3111,7 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx)
|
||||
s->HEVClc = NULL;
|
||||
av_freep(&s->HEVClcList[0]);
|
||||
|
||||
for (i = 0; i < s->pkt.nals_allocated; i++) {
|
||||
av_freep(&s->pkt.nals[i].rbsp_buffer);
|
||||
av_freep(&s->pkt.nals[i].skipped_bytes_pos);
|
||||
}
|
||||
av_freep(&s->pkt.nals);
|
||||
s->pkt.nals_allocated = 0;
|
||||
ff_h2645_packet_uninit(&s->pkt);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -472,12 +472,7 @@ static void hevc_parser_close(AVCodecParserContext *s)
|
||||
|
||||
ctx->ps.sps = NULL;
|
||||
|
||||
for (i = 0; i < ctx->pkt.nals_allocated; i++) {
|
||||
av_freep(&ctx->pkt.nals[i].rbsp_buffer);
|
||||
av_freep(&ctx->pkt.nals[i].skipped_bytes_pos);
|
||||
}
|
||||
av_freep(&ctx->pkt.nals);
|
||||
ctx->pkt.nals_allocated = 0;
|
||||
ff_h2645_packet_uninit(&ctx->pkt);
|
||||
|
||||
av_freep(&ctx->pc.buffer);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user