diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-07-13 13:34:32 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-07-20 20:30:13 +0200 |
commit | 80a64800eab896b1103094a519a35a9585f25f4b (patch) | |
tree | c8cc85dec62be93a5288465c82c34be65871823a /fftools/ffmpeg_enc.c | |
parent | c4b074676a9fff3f072ae4c7e795cf71e010849d (diff) | |
download | ffmpeg-80a64800eab896b1103094a519a35a9585f25f4b.tar.gz |
fftools/ffmpeg_enc: return errors from enc_frame() instead of aborting
Diffstat (limited to 'fftools/ffmpeg_enc.c')
-rw-r--r-- | fftools/ffmpeg_enc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index 8b750de4e5..5952fc42b7 100644 --- a/fftools/ffmpeg_enc.c +++ b/fftools/ffmpeg_enc.c @@ -1129,17 +1129,19 @@ static void do_video_out(OutputFile *of, OutputStream *ost, AVFrame *frame) av_frame_move_ref(e->last_frame, frame); } -void enc_frame(OutputStream *ost, AVFrame *frame) +int enc_frame(OutputStream *ost, AVFrame *frame) { OutputFile *of = output_files[ost->file_index]; int ret; ret = enc_open(ost, frame); if (ret < 0) - exit_program(1); + return ret; if (ost->enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO) do_video_out(of, ost, frame); else do_audio_out(of, ost, frame); + + return 0; } void enc_flush(void) |