av_write_trailer can return a positive value which is not an error

This commit is contained in:
Isaac Connor 2021-11-02 17:10:02 -04:00
parent 0e3f694097
commit dd949bb129
1 changed files with 3 additions and 2 deletions

View File

@ -619,7 +619,8 @@ VideoStore::~VideoStore() {
Debug(1, "Writing trailer");
/* Write the trailer before close */
if (int rc = av_write_trailer(oc)) {
int rc;
if ((rc = av_write_trailer(oc)) < 0) {
Error("Error writing trailer %s", av_err2str(rc));
} else {
Debug(3, "Success Writing trailer");
@ -629,7 +630,7 @@ VideoStore::~VideoStore() {
if (!(out_format->flags & AVFMT_NOFILE)) {
/* Close the out file. */
Debug(4, "Closing");
if (int rc = avio_close(oc->pb)) {
if ((rc = avio_close(oc->pb)) < 0) {
Error("Error closing avio %s", av_err2str(rc));
}
} else {