]> git.sesse.net Git - nageru/blobdiff - decklink_output.cpp
Release Nageru 1.7.4.
[nageru] / decklink_output.cpp
index 091e1b769018026af491d34b4d0df63bd7f2b5c0..28f433a8872945b3191608cc7283eea5fea4669e 100644 (file)
@@ -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)