diff options
author | Gyan Doshi <ffmpeg@gyani.pro> | 2019-09-09 18:33:09 +0530 |
---|---|---|
committer | Gyan Doshi <ffmpeg@gyani.pro> | 2019-11-18 10:01:03 +0530 |
commit | d831edc387c17c25372ff317715b6d6bce235c13 (patch) | |
tree | 216d9d81bf38f90b470af379bee60ee658a4273f /libavdevice/decklink_dec.cpp | |
parent | cda3e8ca04c0e343f5b60fda8fb467936e176f33 (diff) |
avdevice/decklink: add option to drop frames till timecode is seen
Option wait_for_tc only takes effect if tc_format is set
Diffstat (limited to 'libavdevice/decklink_dec.cpp')
-rw-r--r-- | libavdevice/decklink_dec.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp index 4da9122bff..ab7f28112e 100644 --- a/libavdevice/decklink_dec.cpp +++ b/libavdevice/decklink_dec.cpp @@ -784,6 +784,8 @@ HRESULT decklink_input_callback::VideoInputFrameArrived( if (packed_metadata) { if (av_packet_add_side_data(&pkt, AV_PKT_DATA_STRINGS_METADATA, packed_metadata, metadata_len) < 0) av_freep(&packed_metadata); + else if (!ctx->tc_seen) + ctx->tc_seen = ctx->frameCount; } } } @@ -793,6 +795,14 @@ HRESULT decklink_input_callback::VideoInputFrameArrived( } } + if (ctx->tc_format && cctx->wait_for_tc && !ctx->tc_seen) { + + av_log(avctx, AV_LOG_WARNING, "No TC detected yet. wait_for_tc set. Dropping. \n"); + av_log(avctx, AV_LOG_WARNING, "Frame received (#%lu) - " + "- Frames dropped %u\n", ctx->frameCount, ++ctx->dropped); + return S_OK; + } + pkt.pts = get_pkt_pts(videoFrame, audioFrame, wallclock, abs_wallclock, ctx->video_pts_source, ctx->video_st->time_base, &initial_video_pts, cctx->copyts); pkt.dts = pkt.pts; |