| 396 | } |
| 397 | |
| 398 | av_cold int ff_decklink_write_trailer(AVFormatContext *avctx) |
| 399 | { |
| 400 | struct decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data; |
| 401 | struct decklink_ctx *ctx = (struct decklink_ctx *)cctx->ctx; |
| 402 | |
| 403 | if (ctx->playback_started) { |
| 404 | BMDTimeValue actual; |
| 405 | ctx->dlo->StopScheduledPlayback(ctx->last_pts * ctx->bmd_tb_num, |
| 406 | &actual, ctx->bmd_tb_den); |
| 407 | ctx->dlo->DisableVideoOutput(); |
| 408 | if (ctx->audio) |
| 409 | ctx->dlo->DisableAudioOutput(); |
| 410 | } |
| 411 | |
| 412 | ff_decklink_cleanup(avctx); |
| 413 | |
| 414 | if (ctx->output_callback) |
| 415 | delete ctx->output_callback; |
| 416 | |
| 417 | pthread_mutex_destroy(&ctx->mutex); |
| 418 | pthread_cond_destroy(&ctx->cond); |
| 419 | |
| 420 | #if CONFIG_LIBKLVANC |
| 421 | klvanc_context_destroy(ctx->vanc_ctx); |
| 422 | #endif |
| 423 | ff_decklink_packet_queue_end(&ctx->vanc_queue); |
| 424 | |
| 425 | ff_ccfifo_uninit(&ctx->cc_fifo); |
| 426 | av_freep(&cctx->ctx); |
| 427 | |
| 428 | return 0; |
| 429 | } |
| 430 | |
| 431 | #if CONFIG_LIBKLVANC |
| 432 | static void construct_cc(AVFormatContext *avctx, struct decklink_ctx *ctx, |
nothing calls this directly
no test coverage detected