diff --git a/toxav/toxav.c b/toxav/toxav.c index 67fec65d..a51ec5e3 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c @@ -460,6 +460,12 @@ int toxav_prepare_video_frame ( ToxAv *av, int32_t call_index, uint8_t *dest, in return av_ErrorInvalidState; } + if (!(call->cs->capabilities & cs_VideoEncoding)) { + pthread_mutex_unlock(call->mutex); + LOGGER_WARNING("Call doesn't support encoding video: %d", call_index); + return av_ErrorInvalidState; + } + if (cs_set_video_encoder_resolution(call->cs, input->w, input->h) < 0) { pthread_mutex_unlock(call->mutex); return av_ErrorSettingVideoResolution;