]> git.sesse.net Git - nageru/commitdiff
Do not try to stop and restart on DeckLink mode switch if we are not running.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 26 Feb 2017 15:17:45 +0000 (16:17 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 26 Feb 2017 15:17:45 +0000 (16:17 +0100)
decklink_capture.cpp

index 33bb73daa219fa51c31d1ebdd23a3f72709858d5..ea9520705781bcb31da57713e0a0be1d0174e1ee 100644 (file)
@@ -473,20 +473,24 @@ void DeckLinkCapture::stop_dequeue_thread()
 
 void DeckLinkCapture::set_video_mode(uint32_t video_mode_id)
 {
-       if (input->PauseStreams() != S_OK) {
-               fprintf(stderr, "PauseStreams failed\n");
-               exit(1);
-       }
-       if (input->FlushStreams() != S_OK) {
-               fprintf(stderr, "FlushStreams failed\n");
-               exit(1);
+       if (running) {
+               if (input->PauseStreams() != S_OK) {
+                       fprintf(stderr, "PauseStreams failed\n");
+                       exit(1);
+               }
+               if (input->FlushStreams() != S_OK) {
+                       fprintf(stderr, "FlushStreams failed\n");
+                       exit(1);
+               }
        }
 
        set_video_mode_no_restart(video_mode_id);
 
-       if (input->StartStreams() != S_OK) {
-               fprintf(stderr, "StartStreams failed\n");
-               exit(1);
+       if (running) {
+               if (input->StartStreams() != S_OK) {
+                       fprintf(stderr, "StartStreams failed\n");
+                       exit(1);
+               }
        }
 }