diff --git a/src/moq-output.cpp b/src/moq-output.cpp index e08af33..1035fb5 100644 --- a/src/moq-output.cpp +++ b/src/moq-output.cpp @@ -132,6 +132,9 @@ void MoQOutput::Stop(bool signal) } audio_tracks.clear(); + // Clear bytes sent + total_bytes_sent = 0; + if (signal) { obs_output_signal_stop(output, OBS_OUTPUT_SUCCESS); } @@ -147,6 +150,11 @@ void MoQOutput::Data(struct encoder_packet *packet) return; } + // OBS tries to gather data on signalling a stop success. Check once if the video tracks map is filled or new broadcasts fail on Windows. + if (video_tracks.empty()) { + return; + } + if (packet->type == OBS_ENCODER_AUDIO) { AudioData(packet); } else if (packet->type == OBS_ENCODER_VIDEO) {