Browse Source

obs-ffmpeg: Initialize stopping member variable to false

If an output has already stopped, but its StopRecording function was
called again, then ffmpeg_mux_stop would be called and set stopping to
true. On the next output start, OBS would output 1 frame, see that
stopping is true, and then stop the output.

This was most easily observed using an Output Timer to record prior to
93f5b45be8c8b91199c52cf7a0ab59d8c3a08760.

Initialize stopping to false with the other state flags to ensure that
the output has a clean starting state.
Ryan Foster 1 year ago
parent
commit
87c88ef983
1 changed files with 1 additions and 0 deletions
  1. 1 0
      plugins/obs-ffmpeg/obs-ffmpeg-mux.c

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

@@ -465,6 +465,7 @@ static inline bool ffmpeg_mux_start_internal(struct ffmpeg_muxer *stream,
 	/* write headers and start capture */
 	os_atomic_set_bool(&stream->active, true);
 	os_atomic_set_bool(&stream->capturing, true);
+	os_atomic_set_bool(&stream->stopping, false);
 	stream->total_bytes = 0;
 	obs_output_begin_data_capture(stream->output, 0);