From 7f1e5ff72038b055aad7a9edd99e2632db56b3dd Mon Sep 17 00:00:00 2001 From: irungentoo Date: Fri, 4 Jul 2014 20:20:47 -0400 Subject: [PATCH] This seems to fix the crash that happens when changing the resolution of the desktop stream to something higher than the initial one in utox. --- toxav/codec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/toxav/codec.c b/toxav/codec.c index 3664ddd0..a5946b38 100644 --- a/toxav/codec.c +++ b/toxav/codec.c @@ -256,8 +256,8 @@ int init_video_encoder(CodecState *cs, uint16_t width, uint16_t height, uint32_t } cfg.rc_target_bitrate = video_bitrate; - cfg.g_w = width; - cfg.g_h = height; + cfg.g_w = 8192; + cfg.g_h = 8192; cfg.g_pass = VPX_RC_ONE_PASS; cfg.g_error_resilient = VPX_ERROR_RESILIENT_DEFAULT | VPX_ERROR_RESILIENT_PARTITIONS; cfg.g_lag_in_frames = 0; @@ -278,6 +278,9 @@ int init_video_encoder(CodecState *cs, uint16_t width, uint16_t height, uint32_t return -1; } + if (reconfigure_video_encoder_resolution(cs, width, height) != 0) + return -1; + return 0; }