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);
+ pkt->nals_allocated = 0;
+}
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 */
for (i = 0; i < FF_ARRAY_ELEMS(s->ps.pps_list); i++)
av_buffer_unref(&s->ps.pps_list[i]);
- for (i = 0; i < s->pkt.nals_allocated; i++)
- av_freep(&s->pkt.nals[i].rbsp_buffer);
- av_freep(&s->pkt.nals);
- s->pkt.nals_allocated = 0;
+ ff_h2645_packet_uninit(&s->pkt);
return 0;
}
for (i = 0; i < FF_ARRAY_ELEMS(ctx->ps.pps_list); i++)
av_buffer_unref(&ctx->ps.pps_list[i]);
- for (i = 0; i < ctx->pkt.nals_allocated; i++)
- av_freep(&ctx->pkt.nals[i].rbsp_buffer);
- av_freep(&ctx->pkt.nals);
- ctx->pkt.nals_allocated = 0;
+ ff_h2645_packet_uninit(&ctx->pkt);
av_freep(&ctx->pc.buffer);
}