return 0;
fail:
- ff_decode_bsfs_uninit(avctx);
+ av_bsf_free(&avci->bsf);
return ret;
}
if (!avctx->refcounted_frames)
av_frame_unref(avci->to_free);
}
-
-void ff_decode_bsfs_uninit(AVCodecContext *avctx)
-{
- av_bsf_free(&avctx->internal->bsf);
-}
*/
int ff_decode_get_packet(AVCodecContext *avctx, AVPacket *pkt);
+/**
+ * Called during avcodec_open2() to initialize avctx->internal->bsf.
+ * The bsf should be freed with av_bsf_free().
+ */
int ff_decode_bsfs_init(AVCodecContext *avctx);
-void ff_decode_bsfs_uninit(AVCodecContext *avctx);
-
/**
* Make sure avctx.hw_frames_ctx is set. If it's not set, the function will
* try to allocate it from hw_device_ctx. If that is not possible, an error
av_packet_free(&avci->last_pkt_props);
av_packet_free(&avci->ds.in_pkt);
- ff_decode_bsfs_uninit(avctx);
+ av_bsf_free(&avci->bsf);
av_buffer_unref(&avci->pool);
}
avctx->hwaccel->uninit(avctx);
av_freep(&avctx->internal->hwaccel_priv_data);
- ff_decode_bsfs_uninit(avctx);
+ av_bsf_free(&avctx->internal->bsf);
av_freep(&avctx->internal);
}