Explorar o código

libobs, obs-ffmpeg: Use correct value for EINVAL error check

FFmpeg functions such as av_interleaved_write_frame return negative
on error, so all errno values are negated.
Richard Stanway %!s(int64=4) %!d(string=hai) anos
pai
achega
e5c6839904

+ 1 - 1
libobs/media-io/media-remux.c

@@ -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;

+ 1 - 1
plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c

@@ -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;
 	}