X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavdevice%2Fdecklink_enc.cpp;h=4c1eb05be4b3c6895501aa6e44ddc86ff38a1fb0;hb=ef6a9e5e311f09fa8032974fa4d0c1e166a959bb;hp=8b621d00543e6fe3a9af0b770e7eaf1f04b69c7a;hpb=92219ef4ac01b00e630b39cb19e8fbd17fdb63d0;p=ffmpeg diff --git a/libavdevice/decklink_enc.cpp b/libavdevice/decklink_enc.cpp index 8b621d00543..4c1eb05be4b 100644 --- a/libavdevice/decklink_enc.cpp +++ b/libavdevice/decklink_enc.cpp @@ -32,6 +32,7 @@ extern "C" { extern "C" { #include "libavformat/avformat.h" +#include "libavutil/internal.h" #include "libavutil/imgutils.h" #include "avdevice.h" } @@ -197,8 +198,11 @@ static int decklink_setup_video(AVFormatContext *avctx, AVStream *st) " Check available formats with -list_formats 1.\n"); return -1; } - if (ctx->dlo->EnableVideoOutput(ctx->bmd_mode, - ctx->supports_vanc ? bmdVideoOutputVANC : bmdVideoOutputFlagDefault) != S_OK) { + if (ctx->supports_vanc && ctx->dlo->EnableVideoOutput(ctx->bmd_mode, bmdVideoOutputVANC) != S_OK) { + av_log(avctx, AV_LOG_WARNING, "Could not enable video output with VANC! Trying without...\n"); + ctx->supports_vanc = 0; + } + if (!ctx->supports_vanc && ctx->dlo->EnableVideoOutput(ctx->bmd_mode, bmdVideoOutputFlagDefault) != S_OK) { av_log(avctx, AV_LOG_ERROR, "Could not enable video output!\n"); return -1; } @@ -309,7 +313,8 @@ static void construct_cc(AVFormatContext *avctx, struct decklink_ctx *ctx, uint16_t *cdp_words; uint16_t len; uint8_t cc_count; - int size, ret, i; + size_t size; + int ret, i; const uint8_t *data = av_packet_get_side_data(pkt, AV_PKT_DATA_A53_CC, &size); if (!data) @@ -433,7 +438,7 @@ static int decklink_write_video_packet(AVFormatContext *avctx, AVPacket *pkt) AVFrame *avframe = NULL, *tmp = (AVFrame *)pkt->data; AVPacket *avpacket = NULL; decklink_frame *frame; - buffercount_type buffered; + uint32_t buffered; HRESULT hr; if (st->codecpar->codec_id == AV_CODEC_ID_WRAPPED_AVFRAME) { @@ -522,7 +527,7 @@ static int decklink_write_audio_packet(AVFormatContext *avctx, AVPacket *pkt) struct decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data; struct decklink_ctx *ctx = (struct decklink_ctx *)cctx->ctx; int sample_count = pkt->size / (ctx->channels << 1); - buffercount_type buffered; + uint32_t buffered; ctx->dlo->GetBufferedAudioSampleFrameCount(&buffered); if (pkt->pts > 1 && !buffered)