From 25904455bb78c0a813b302f54eb8c3c615cbb38d Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 27 Mar 2023 11:55:46 -0400 Subject: [PATCH] MT#55283 add extra output-open test The `encoder` is actually persistent and only freed when the output is freed, so testing for its existence is not enough to determine whether the output is open. The `fmtctx` can be used for that. Change-Id: I2cc3f00a0e983fafd5915736089a0421385b6ce3 (cherry picked from commit 833c30d69e13ed37ff8b04397fb95e3246abcb2f) --- recording-daemon/output.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recording-daemon/output.c b/recording-daemon/output.c index 9d4ba9707..a747e9360 100644 --- a/recording-daemon/output.c +++ b/recording-daemon/output.c @@ -45,6 +45,8 @@ int output_add(output_t *output, AVFrame *frame) { return -1; if (!output->encoder) // not ready - not configured return -1; + if (!output->fmtctx) // output not open + return -1; return encoder_input_fifo(output->encoder, frame, output_got_packet, output, NULL); }