From 9108c64c9eb43c1c5de0b31926aaf3bdd144ff79 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 23 Oct 2017 14:14:54 -0500 Subject: [PATCH] FS-10752: [mod_av] Remove support for AVENC which is not working on deb9 #resolve --- src/mod/applications/mod_av/avcodec.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mod/applications/mod_av/avcodec.c b/src/mod/applications/mod_av/avcodec.c index 43e39ad429..9c320d1123 100644 --- a/src/mod/applications/mod_av/avcodec.c +++ b/src/mod/applications/mod_av/avcodec.c @@ -824,6 +824,7 @@ static switch_status_t open_encoder(h264_codec_context_t *context, uint32_t widt int sane = 0; int threads = switch_core_cpu_count(); +#ifdef NVENC_SUPPORT if (!context->encoder) { if (context->av_codec_id == AV_CODEC_ID_H264) { if (context->codec_settings.video.try_hardware_encoder && (context->encoder = avcodec_find_encoder_by_name("nvenc_h264"))) { @@ -833,12 +834,15 @@ static switch_status_t open_encoder(h264_codec_context_t *context, uint32_t widt switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "NVENC HW CODEC NOT PRESENT\n"); } } + } +#endif - if (!context->encoder) { - context->encoder = avcodec_find_encoder(context->av_codec_id); - } + + if (!context->encoder) { + context->encoder = avcodec_find_encoder(context->av_codec_id); } + if (!context->encoder) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot find encoder id: %d\n", context->av_codec_id); return SWITCH_STATUS_FALSE;