avcodec/h2645_sei: Factor out freeing common SEI parts

This commit only factors out freeing the common SEI parts,
not whether the fields indicating whether an SEI is present
shall be reset. H.264 and HEVC differ in this regard
(ff_h264_sei_uninit() really resets, whereas ff_hevc_reset_sei()
only uninits.) and neither actually honours the persistency
as prescribed by the relevant specs.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2022-07-02 20:52:31 +02:00
parent de5891d371
commit f89825e60a
5 changed files with 20 additions and 19 deletions

View File

@@ -59,11 +59,7 @@ void ff_h264_sei_uninit(H264SEIContext *h)
h->common.display_orientation.present = 0;
h->common.afd.present = 0;
av_buffer_unref(&h->common.a53_caption.buf_ref);
for (int i = 0; i < h->common.unregistered.nb_buf_ref; i++)
av_buffer_unref(&h->common.unregistered.buf_ref[i]);
h->common.unregistered.nb_buf_ref = 0;
av_freep(&h->common.unregistered.buf_ref);
ff_h2645_sei_reset(&h->common);
}
int ff_h264_sei_process_picture_timing(H264SEIPictureTiming *h, const SPS *sps,