From patchwork Sat Feb 22 18:29:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 17865 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 8D53B44A816 for ; Sat, 22 Feb 2020 20:30:01 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6A32468B31C; Sat, 22 Feb 2020 20:30:01 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C4CA168AFBB for ; Sat, 22 Feb 2020 20:29:54 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id ACDB7E3616; Sat, 22 Feb 2020 19:29:54 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a5Cb7yVuhJMw; Sat, 22 Feb 2020 19:29:53 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id C6924E1982; Sat, 22 Feb 2020 19:29:52 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sat, 22 Feb 2020 19:29:47 +0100 Message-Id: <20200222182948.5538-1-cus@passwd.hu> X-Mailer: git-send-email 2.16.4 Subject: [FFmpeg-devel] [PATCH 1/2] avdevice/decklink_dec: fix stopping streams in read_close X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The capture_started variable was never set, it is simpler to call the stop functions unconditionally if the interface is available. Signed-off-by: Marton Balint --- libavdevice/decklink_common.h | 1 - libavdevice/decklink_dec.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/libavdevice/decklink_common.h b/libavdevice/decklink_common.h index 8b3dbce2fb..27ce6a8a40 100644 --- a/libavdevice/decklink_common.h +++ b/libavdevice/decklink_common.h @@ -115,7 +115,6 @@ struct decklink_ctx { /* Status */ int playback_started; - int capture_started; int64_t last_pts; unsigned long frameCount; unsigned int dropped; diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp index 1fd5adf515..c8d931517e 100644 --- a/libavdevice/decklink_dec.cpp +++ b/libavdevice/decklink_dec.cpp @@ -983,7 +983,7 @@ av_cold int ff_decklink_read_close(AVFormatContext *avctx) struct decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data; struct decklink_ctx *ctx = (struct decklink_ctx *)cctx->ctx; - if (ctx->capture_started) { + if (ctx->dli) { ctx->dli->StopStreams(); ctx->dli->DisableVideoInput(); ctx->dli->DisableAudioInput();