X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=decklink_output.cpp;h=28f433a8872945b3191608cc7283eea5fea4669e;hb=refs%2Ftags%2F1.7.4;hp=091e1b769018026af491d34b4d0df63bd7f2b5c0;hpb=d58634eed0ef4a32b6d45081bcfb85aba1f3f379;p=nageru diff --git a/decklink_output.cpp b/decklink_output.cpp index 091e1b7..28f433a 100644 --- a/decklink_output.cpp +++ b/decklink_output.cpp @@ -82,17 +82,17 @@ DeckLinkOutput::DeckLinkOutput(ResourcePool *resource_pool, QSurface *surface, u }); } -void DeckLinkOutput::set_device(IDeckLink *decklink) +bool DeckLinkOutput::set_device(IDeckLink *decklink) { if (decklink->QueryInterface(IID_IDeckLinkOutput, (void**)&output) != S_OK) { - fprintf(stderr, "Card %u has no outputs\n", card_index); - exit(1); + fprintf(stderr, "Warning: Card %u has no outputs\n", card_index); + return false; } IDeckLinkDisplayModeIterator *mode_it; if (output->GetDisplayModeIterator(&mode_it) != S_OK) { - fprintf(stderr, "Failed to enumerate output display modes for card %u\n", card_index); - exit(1); + fprintf(stderr, "Warning: Failed to enumerate output display modes for card %u\n", card_index); + return false; } video_modes.clear(); @@ -115,9 +115,12 @@ void DeckLinkOutput::set_device(IDeckLink *decklink) // HDMI or SDI generally mean “both HDMI and SDI at the same time” on DeckLink cards // that support both; pick_default_video_connection() will generally pick one of those - // if they exist. We're not very likely to need analog outputs, so we don't need a way - // to change beyond that. + // if they exist. (--prefer-hdmi-input would also affect the selection despite the name + // of the option, but since either generally means both, it's inconsequential.) + // We're not very likely to need analog outputs, so we don't need a way to change + // beyond that. video_connection = pick_default_video_connection(decklink, BMDDeckLinkVideoOutputConnections, card_index); + return true; } void DeckLinkOutput::start_output(uint32_t mode, int64_t base_pts)