summaryrefslogtreecommitdiff
path: root/toxav/codec.c
diff options
context:
space:
mode:
authormannol <eniz_vukovic@hotmail.com>2014-07-03 16:58:00 +0200
committermannol <eniz_vukovic@hotmail.com>2014-07-03 16:58:00 +0200
commitd3560a3a77dea199d25d0209288e07aeb5909abb (patch)
treebbf908194bebc0b28e7d62d21fe4e83b68ccdd2e /toxav/codec.c
parentaeaf997ca57052a1589699c8ddfd9a75ca398180 (diff)
Removed redundant code and fixed toxav codec actions being called when call inactive
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..33fe5627 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