fftools/ffmpeg_enc: return errors from enc_flush() instead of aborting

This commit is contained in:
Anton Khirnov 2023-07-13 13:34:32 +02:00
parent dde3de0170
commit 43bcf631d0
3 changed files with 6 additions and 4 deletions

View File

@ -1250,7 +1250,7 @@ static int transcode(int *err_rate_exceeded)
} else if (err_rate)
av_log(ist, AV_LOG_VERBOSE, "Decode error rate %g\n", err_rate);
}
enc_flush();
ret = err_merge(ret, enc_flush());
term_exit();

View File

@ -815,7 +815,7 @@ void enc_free(Encoder **penc);
int enc_open(OutputStream *ost, AVFrame *frame);
int enc_subtitle(OutputFile *of, OutputStream *ost, const AVSubtitle *sub);
int enc_frame(OutputStream *ost, AVFrame *frame);
void enc_flush(void);
int enc_flush(void);
/*
* Initialize muxing state for the given stream, should be called

View File

@ -1147,7 +1147,7 @@ int enc_frame(OutputStream *ost, AVFrame *frame)
do_video_out(of, ost, frame) : do_audio_out(of, ost, frame);
}
void enc_flush(void)
int enc_flush(void)
{
int ret;
@ -1168,6 +1168,8 @@ void enc_flush(void)
ret = submit_encode_frame(of, ost, NULL);
if (ret != AVERROR_EOF)
exit_program(1);
return ret;
}
return 0;
}