From: Steinar H. Gunderson Date: Sun, 26 Feb 2017 15:17:45 +0000 (+0100) Subject: Do not try to stop and restart on DeckLink mode switch if we are not running. X-Git-Tag: 1.5.0~27 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=90598079cba30f18714212ecd3f8602d7bcdfa67;p=nageru Do not try to stop and restart on DeckLink mode switch if we are not running. --- diff --git a/decklink_capture.cpp b/decklink_capture.cpp index 33bb73d..ea95207 100644 --- a/decklink_capture.cpp +++ b/decklink_capture.cpp @@ -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); + } } }