Browse Source

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 2 years ago
parent
commit
0f614034ca
1 changed files with 6 additions and 1 deletions
  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);
 	}