Esempio n. 1
0
static inline bool obs_encoder_initialize_internal(obs_encoder_t *encoder)
{
	if (encoder_active(encoder))
		return true;
	if (encoder->initialized)
		return true;

	obs_encoder_shutdown(encoder);

	if (encoder->info.create)
		encoder->context.data = encoder->info.create(
				encoder->context.settings, encoder);
	if (!encoder->context.data)
		return false;

	if (encoder->info.type == OBS_ENCODER_AUDIO)
		intitialize_audio_encoder(encoder);

	encoder->initialized = true;
	return true;
}
Esempio n. 2
0
bool obs_encoder_initialize(obs_encoder_t *encoder)
{
	if (!encoder) return false;

	if (encoder->active)
		return true;

	if (encoder->context.data)
		encoder->info.destroy(encoder->context.data);

	encoder->context.data = encoder->info.create(encoder->context.settings,
			encoder);
	if (!encoder->context.data)
		return false;

	encoder->paired_encoder  = NULL;
	encoder->start_ts        = 0;

	if (encoder->info.type == OBS_ENCODER_AUDIO)
		intitialize_audio_encoder(encoder);

	return true;
}