libobs: Initialize service before starting output

This fixes the case where initialize is not called on a service if the
output is not encoded.
master
Matthew Orlando 2018-10-10 18:11:37 -07:00 committed by Andersama
parent f41bc2c32b
commit 09d77878fd
1 changed files with 5 additions and 3 deletions

View File

@ -255,13 +255,17 @@ bool obs_output_actual_start(obs_output_t *output)
bool obs_output_start(obs_output_t *output)
{
bool encoded;
bool has_service;
if (!obs_output_valid(output, "obs_output_start"))
return false;
if (!output->context.data)
return false;
encoded = (output->info.flags & OBS_OUTPUT_ENCODED) != 0;
has_service = (output->info.flags & OBS_OUTPUT_SERVICE) != 0;
if (has_service && !obs_service_initialize(output->service, output))
return false;
encoded = (output->info.flags & OBS_OUTPUT_ENCODED) != 0;
if (encoded && output->delay_sec) {
return obs_output_delay_start(output);
} else {
@ -1746,8 +1750,6 @@ bool obs_output_initialize_encoders(obs_output_t *output, uint32_t flags)
if (!encoded)
return false;
if (has_service && !obs_service_initialize(output->service, output))
return false;
if (has_video && !obs_encoder_initialize(output->video_encoder))
return false;
if (has_audio && !initialize_audio_encoders(output, num_mixes))