Explorar o código

obs-ffmpeg: Handle mux errors when writing replay buffer

Without this, we could continuously call signal_failure in write_packet,
crashing OBS with a stack overflow with all the error callbacks.
Richard Stanway %!s(int64=2) %!d(string=hai) anos
pai
achega
0f614034ca
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      plugins/obs-ffmpeg/obs-ffmpeg-mux.c

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

@@ -1176,7 +1176,12 @@ static void *replay_buffer_mux_thread(void *data)
 
 	for (size_t i = 0; i < stream->mux_packets.num; i++) {
 		struct encoder_packet *pkt = &stream->mux_packets.array[i];
-		write_packet(stream, pkt);
+		if (!write_packet(stream, pkt)) {
+			warn("Could not write packet for file '%s'",
+			     stream->path.array);
+			error = true;
+			goto error;
+		}
 		obs_encoder_packet_release(pkt);
 	}