From 0e0f477b11fef9cf973e0e1f8064ff47ae00e178 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 166c09e89..f016d6ecc 100644 --- a/recording-daemon/output.c +++ b/recording-daemon/output.c @@ -43,6 +43,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); }