fftools/ffmpeg_mux_init: move allocation out of prologue

ost_add() has a very large variable declaration prologue, performing
"active" actions that can fail in there is confusing.
This commit is contained in:
Anton Khirnov 2023-07-12 16:22:43 +02:00
parent 4e366100e9
commit 38a2fc2c29
1 changed files with 2 additions and 1 deletions

View File

@ -987,13 +987,14 @@ static OutputStream *ost_add(Muxer *mux, const OptionsContext *o,
MuxStream *ms;
OutputStream *ost;
const AVCodec *enc;
AVStream *st = avformat_new_stream(oc, NULL);
AVStream *st;
int ret = 0;
const char *bsfs = NULL, *time_base = NULL;
char *filters = NULL, *next, *codec_tag = NULL;
double qscale = -1;
int i;
st = avformat_new_stream(oc, NULL);
if (!st)
report_and_exit(AVERROR(ENOMEM));