summaryrefslogtreecommitdiff
path: root/toxav/toxav.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-07-05 14:36:19 -0400
committerirungentoo <irungentoo@gmail.com>2014-07-05 14:36:19 -0400
commit65b4c026f4a2aa965f89f28958fe75bceb16475c (patch)
tree6c7eb2c6760c2606f7e86bc03777c4abcb92b2ee /toxav/toxav.c
parentbdb00322e3ecb9eb213ce01688089cdad39304f0 (diff)
The width and height set during the video encoder initialization is
now described as the maximum width and height of images. This is to work around what appears to be a bug in libvpx where the resolution of the stream can be decreased but increasing it above its originally set value introduces memory corruption.
Diffstat (limited to 'toxav/toxav.c')
-rw-r--r--toxav/toxav.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/toxav/toxav.c b/toxav/toxav.c
index 9a1c5e3e..606f1370 100644
--- a/toxav/toxav.c
+++ b/toxav/toxav.c
@@ -81,8 +81,8 @@ struct _ToxAv {
81 81
82const ToxAvCodecSettings av_DefaultSettings = { 82const ToxAvCodecSettings av_DefaultSettings = {
83 500, 83 500,
84 800, 84 1280,
85 600, 85 720,
86 86
87 64000, 87 64000,
88 20, 88 20,
@@ -350,8 +350,8 @@ int toxav_prepare_transmission ( ToxAv *av, int32_t call_index, ToxAvCodecSettin
350 codec_settings->audio_sample_rate, 350 codec_settings->audio_sample_rate,
351 codec_settings->audio_channels, 351 codec_settings->audio_channels,
352 codec_settings->audio_VAD_tolerance, 352 codec_settings->audio_VAD_tolerance,
353 codec_settings->video_width, 353 codec_settings->max_video_width,
354 codec_settings->video_height, 354 codec_settings->max_video_height,
355 codec_settings->video_bitrate) )) { 355 codec_settings->video_bitrate) )) {
356 356
357 if ( pthread_mutex_init(&call->mutex, NULL) != 0 ) goto error; 357 if ( pthread_mutex_init(&call->mutex, NULL) != 0 ) goto error;
@@ -642,7 +642,8 @@ inline__ int toxav_prepare_video_frame(ToxAv *av, int32_t call_index, uint8_t *d
642 CallSpecific *call = &av->calls[call_index]; 642 CallSpecific *call = &av->calls[call_index];
643 pthread_mutex_lock(&call->mutex); 643 pthread_mutex_lock(&call->mutex);
644 644
645 reconfigure_video_encoder_resolution(call->cs, input->d_w, input->d_h); 645 if (reconfigure_video_encoder_resolution(call->cs, input->d_w, input->d_h) != 0)
646 return ErrorInternal;
646 647
647 int rc = vpx_codec_encode(&call->cs->v_encoder, input, call->cs->frame_counter, 1, 0, MAX_ENCODE_TIME_US); 648 int rc = vpx_codec_encode(&call->cs->v_encoder, input, call->cs->frame_counter, 1, 0, MAX_ENCODE_TIME_US);
648 649