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 833c30d69e)
pull/1649/head
Richard Fuchs 3 years ago
parent 216db7d998
commit 0e0f477b11

@ -43,6 +43,8 @@ int output_add(output_t *output, AVFrame *frame) {
return -1; return -1;
if (!output->encoder) // not ready - not configured if (!output->encoder) // not ready - not configured
return -1; return -1;
if (!output->fmtctx) // output not open
return -1;
return encoder_input_fifo(output->encoder, frame, output_got_packet, output, NULL); return encoder_input_fifo(output->encoder, frame, output_got_packet, output, NULL);
} }

Loading…
Cancel
Save