From 90598079cba30f18714212ecd3f8602d7bcdfa67 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 26 Feb 2017 16:17:45 +0100 Subject: [PATCH] Do not try to stop and restart on DeckLink mode switch if we are not running. --- decklink_capture.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) 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); + } } } -- 2.39.2