]> git.sesse.net Git - ffmpeg/commitdiff
avdevice/decklink_dec: fix stopping streams in read_close
authorMarton Balint <cus@passwd.hu>
Fri, 21 Feb 2020 19:39:31 +0000 (20:39 +0100)
committerMarton Balint <cus@passwd.hu>
Wed, 26 Feb 2020 20:32:56 +0000 (21:32 +0100)
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 <cus@passwd.hu>
libavdevice/decklink_common.h
libavdevice/decklink_dec.cpp

index 8b3dbce2fb435020c386b102d3358afa0b872a91..27ce6a8a402f6a4f2b339d642adf71ead007cced 100644 (file)
@@ -115,7 +115,6 @@ struct decklink_ctx {
 
     /* Status */
     int playback_started;
-    int capture_started;
     int64_t last_pts;
     unsigned long frameCount;
     unsigned int dropped;
index 1fd5adf515672a594e7c2955091638f79ea89ca2..c8d931517e4375e0daf8d54a2456bb1a13743600 100644 (file)
@@ -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();