Skip to content

Commit

Permalink
obs-ffmpeg: obs-ffmpeg-nvenc.c: clang-format doing formatting things
Browse files Browse the repository at this point in the history
  • Loading branch information
Bleuzen committed Apr 23, 2023
1 parent efe2c0c commit 30648a4
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions plugins/obs-ffmpeg/obs-ffmpeg-nvenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ static void on_first_packet(void *data, AVPacket *pkt, struct darray *da)
&enc->sei.array, &enc->sei.num);
} else
#endif
if (enc->av1) {
if (enc->av1) {
// TODO: add obs_extract_av1_headers
} else {
obs_extract_avc_headers(pkt->data, pkt->size,
Expand Down Expand Up @@ -332,11 +332,10 @@ static void *nvenc_create_internal(obs_data_t *settings, obs_encoder_t *encoder,
#else
UNUSED_PARAMETER(hevc);
#endif
if (av1) {
if (!ffmpeg_video_encoder_init(&enc->ffve, enc, encoder,
"av1_nvenc", "nvenc_av1",
ENCODER_NAME_AV1, on_init_error,
on_first_packet))
if (av1) {
if (!ffmpeg_video_encoder_init(
&enc->ffve, enc, encoder, "av1_nvenc", "nvenc_av1",
ENCODER_NAME_AV1, on_init_error, on_first_packet))
goto fail;
} else {
if (!ffmpeg_video_encoder_init(&enc->ffve, enc, encoder,
Expand Down Expand Up @@ -382,12 +381,14 @@ static void *h264_nvenc_create(obs_data_t *settings, obs_encoder_t *encoder)
}

bool psycho_aq = obs_data_get_bool(settings, "psycho_aq");
void *enc = nvenc_create_internal(settings, encoder, psycho_aq, false, false);
void *enc = nvenc_create_internal(settings, encoder, psycho_aq, false,
false);
if ((enc == NULL) && psycho_aq) {
blog(LOG_WARNING,
"[NVENC encoder] nvenc_create_internal failed, "
"trying again without Psycho Visual Tuning");
enc = nvenc_create_internal(settings, encoder, false, false, false);
enc = nvenc_create_internal(settings, encoder, false, false,
false);
}

return enc;
Expand Down Expand Up @@ -421,12 +422,14 @@ static void *hevc_nvenc_create(obs_data_t *settings, obs_encoder_t *encoder)
}

bool psycho_aq = obs_data_get_bool(settings, "psycho_aq");
void *enc = nvenc_create_internal(settings, encoder, psycho_aq, true, false);
void *enc = nvenc_create_internal(settings, encoder, psycho_aq, true,
false);
if ((enc == NULL) && psycho_aq) {
blog(LOG_WARNING,
"[NVENC encoder] nvenc_create_internal failed, "
"trying again without Psycho Visual Tuning");
enc = nvenc_create_internal(settings, encoder, false, true, false);
enc = nvenc_create_internal(settings, encoder, false, true,
false);
}

return enc;
Expand Down Expand Up @@ -459,12 +462,14 @@ static void *av1_nvenc_create(obs_data_t *settings, obs_encoder_t *encoder)
}

bool psycho_aq = obs_data_get_bool(settings, "psycho_aq");
void *enc = nvenc_create_internal(settings, encoder, psycho_aq, false, true);
void *enc = nvenc_create_internal(settings, encoder, psycho_aq, false,
true);
if ((enc == NULL) && psycho_aq) {
blog(LOG_WARNING,
"[NVENC encoder] nvenc_create_internal failed, "
"trying again without Psycho Visual Tuning");
enc = nvenc_create_internal(settings, encoder, false, false, true);
enc = nvenc_create_internal(settings, encoder, false, false,
true);
}

return enc;
Expand Down

0 comments on commit 30648a4

Please sign in to comment.