summaryrefslogtreecommitdiff
path: root/toxav/codec.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxav/codec.c')
-rw-r--r--toxav/codec.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/toxav/codec.c b/toxav/codec.c
index 9ca9a50c..3e6de803 100644
--- a/toxav/codec.c
+++ b/toxav/codec.c
@@ -1,4 +1,4 @@
1/** media.c 1/** codec.c
2 * 2 *
3 * Audio and video codec intitialization, encoding/decoding and playback 3 * Audio and video codec intitialization, encoding/decoding and playback
4 * 4 *
@@ -212,7 +212,7 @@ int init_video_encoder(CodecState *cs, uint16_t width, uint16_t height, uint32_t
212 vpx_codec_enc_cfg_t cfg; 212 vpx_codec_enc_cfg_t cfg;
213 int rc = vpx_codec_enc_config_default(VIDEO_CODEC_ENCODER_INTERFACE, &cfg, 0); 213 int rc = vpx_codec_enc_config_default(VIDEO_CODEC_ENCODER_INTERFACE, &cfg, 0);
214 214
215 if (rc) { 215 if (rc != VPX_CODEC_OK) {
216 LOGGER_ERROR("Failed to get config: %s", vpx_codec_err_to_string(rc)); 216 LOGGER_ERROR("Failed to get config: %s", vpx_codec_err_to_string(rc));
217 return -1; 217 return -1;
218 } 218 }
@@ -234,6 +234,12 @@ int init_video_encoder(CodecState *cs, uint16_t width, uint16_t height, uint32_t
234 } 234 }
235 235
236 rc = vpx_codec_control(&cs->v_encoder, VP8E_SET_CPUUSED, 7); 236 rc = vpx_codec_control(&cs->v_encoder, VP8E_SET_CPUUSED, 7);
237
238 if ( rc != VPX_CODEC_OK) {
239 LOGGER_ERROR("Failed to set encoder control setting: %s", vpx_codec_err_to_string(rc));
240 return -1;
241 }
242
237 return 0; 243 return 0;
238} 244}
239 245