FFmpeg functions such as av_interleaved_write_frame return negative on error, so all errno values are negated.
@@ -227,7 +227,7 @@ static inline int process_packets(media_remux_job_t job,
/* Treat "Invalid data found when processing input" and
* "Invalid argument" as non-fatal */
- if (ret == AVERROR_INVALIDDATA || ret == EINVAL)
+ if (ret == AVERROR_INVALIDDATA || ret == -EINVAL)
continue;
break;
@@ -808,7 +808,7 @@ static inline bool ffmpeg_mux_packet(struct ffmpeg_mux *ffm, uint8_t *buf,
}
/* Treat "Invalid data found when processing input" and "Invalid argument" as non-fatal */
- if (ret == AVERROR_INVALIDDATA || ret == EINVAL) {
+ if (ret == AVERROR_INVALIDDATA || ret == -EINVAL) {
return true;