fftools/ffmpeg_mux: return errors from of_output_packet() instead of aborting

This commit is contained in:
Anton Khirnov
2023-07-13 13:34:32 +02:00
parent 2b4afe8169
commit e0f4259689
4 changed files with 21 additions and 17 deletions

View File

@@ -559,7 +559,9 @@ int enc_subtitle(OutputFile *of, OutputStream *ost, const AVSubtitle *sub)
}
pkt->dts = pkt->pts;
of_output_packet(of, ost, pkt);
ret = of_output_packet(of, ost, pkt);
if (ret < 0)
return ret;
}
return 0;
@@ -752,8 +754,8 @@ static int encode_frame(OutputFile *of, OutputStream *ost, AVFrame *frame)
av_assert0(frame); // should never happen during flushing
return 0;
} else if (ret == AVERROR_EOF) {
of_output_packet(of, ost, NULL);
return ret;
ret = of_output_packet(of, ost, NULL);
return ret < 0 ? ret : AVERROR_EOF;
} else if (ret < 0) {
av_log(ost, AV_LOG_ERROR, "%s encoding failed\n", type_desc);
return ret;
@@ -790,7 +792,9 @@ static int encode_frame(OutputFile *of, OutputStream *ost, AVFrame *frame)
e->packets_encoded++;
of_output_packet(of, ost, pkt);
ret = of_output_packet(of, ost, pkt);
if (ret < 0)
return ret;
}
av_assert0(0);