Check if call supports video encoding before encoding frame.

This commit is contained in:
irungentoo 2015-05-09 16:09:48 -04:00
parent 6a4c2e8fc6
commit b2350f2e26
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98

View File

@ -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;