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 2aa7293326
commit 5d93e9a957
1 changed files with 3 additions and 2 deletions

View File

@ -638,7 +638,8 @@ VideoStore::~VideoStore() {
Debug(1, "Writing trailer"); Debug(1, "Writing trailer");
/* Write the trailer before close */ /* 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)); Error("Error writing trailer %s", av_err2str(rc));
} else { } else {
Debug(3, "Success Writing trailer"); Debug(3, "Success Writing trailer");
@ -648,7 +649,7 @@ VideoStore::~VideoStore() {
if (!(out_format->flags & AVFMT_NOFILE)) { if (!(out_format->flags & AVFMT_NOFILE)) {
/* Close the out file. */ /* Close the out file. */
Debug(4, "Closing"); 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)); Error("Error closing avio %s", av_err2str(rc));
} }
} else { } else {