avcodec/videotoolbox: use early return in videotoolbox_default_free

Cosmetic change only.

Signed-off-by: Aman Gupta <aman@tmm1.net>
This commit is contained in:
Aman Gupta 2017-11-10 11:59:05 -08:00
parent 230b91cdfd
commit 631296ff99

View File

@ -849,15 +849,15 @@ static int videotoolbox_default_init(AVCodecContext *avctx)
static void videotoolbox_default_free(AVCodecContext *avctx)
{
AVVideotoolboxContext *videotoolbox = videotoolbox_get_context(avctx);
if (!videotoolbox)
return;
if (videotoolbox) {
if (videotoolbox->cm_fmt_desc)
CFRelease(videotoolbox->cm_fmt_desc);
if (videotoolbox->cm_fmt_desc)
CFRelease(videotoolbox->cm_fmt_desc);
if (videotoolbox->session) {
VTDecompressionSessionInvalidate(videotoolbox->session);
CFRelease(videotoolbox->session);
}
if (videotoolbox->session) {
VTDecompressionSessionInvalidate(videotoolbox->session);
CFRelease(videotoolbox->session);
}
}