From c18e2b4d758b41b7d2ffbe276fa28cb4598b065d Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 12 Aug 2022 09:50:31 +0200 Subject: [PATCH] DeckLink cap.: small refactor --- src/video_capture/decklink.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/video_capture/decklink.cpp b/src/video_capture/decklink.cpp index 251b68d73..9760a28ae 100644 --- a/src/video_capture/decklink.cpp +++ b/src/video_capture/decklink.cpp @@ -1659,6 +1659,9 @@ vidcap_decklink_grab(void *state, struct audio_frame **audio) ++count; } } + if (count < s->devices_cnt) { + return NULL; + } if (s->codec == RGBA) { for (unsigned i = 0; i < s->frame->tile_count; ++i) { vc_copylineToRGBA_inplace((unsigned char*) s->frame->tiles[i].data, @@ -1666,15 +1669,10 @@ vidcap_decklink_grab(void *state, struct audio_frame **audio) s->frame->tiles[i].data_len, 16, 8, 0); } } - if (count == s->devices_cnt) { - s->frames++; - s->frame->timecode = s->state[0].delegate->timecode; - - return s->frame; - } - - return NULL; + s->frames++; + s->frame->timecode = s->state[0].delegate->timecode; + return s->frame; } /* function from DeckLink SDK sample DeviceList */