avdevice/decklink: factorize cleanup function to common code

Reviewed-by: Deti Fliegl <deti@fliegl.de>
Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
Marton Balint 2016-06-18 15:49:01 +02:00
parent 340cea9f22
commit 1fc85d8511
4 changed files with 18 additions and 17 deletions

View file

@ -419,11 +419,7 @@ av_cold int ff_decklink_read_close(AVFormatContext *avctx)
ctx->dli->DisableAudioInput();
}
if (ctx->dli)
ctx->dli->Release();
if (ctx->dl)
ctx->dl->Release();
ff_decklink_cleanup(avctx);
avpacket_queue_end(&ctx->queue);
av_freep(&cctx->ctx);
@ -620,10 +616,7 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
return 0;
error:
ctx->dli->Release();
ctx->dl->Release();
ff_decklink_cleanup(avctx);
return AVERROR(EIO);
}