0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-19 20:32:15 +02:00

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
93f5b45be8.

Initialize stopping to false with the other state flags to ensure that
the output has a clean starting state.
This commit is contained in:
Ryan Foster 2023-11-20 17:15:18 -05:00 committed by Lain
parent 1265950eaf
commit 87c88ef983

View File

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