FS-9267 #resolve [Raw decoded image from vpx codec is corrupted by video media bugs that modify the image]

This commit is contained in:
Anthony Minessale
2016-06-15 21:08:46 -05:00
parent dd5c4a539c
commit b0be5d6737
4 changed files with 27 additions and 5 deletions
+10
View File
@@ -299,6 +299,7 @@ struct vpx_context {
switch_memory_pool_t *pool;
switch_buffer_t *pbuffer;
switch_time_t start_time;
switch_image_t *patch_img;
};
typedef struct vpx_context vpx_context_t;
@@ -1264,6 +1265,12 @@ end:
switch_set_flag(frame, SFF_WAIT_KEY_FRAME);
}
if (frame->img && (codec->flags & SWITCH_CODEC_FLAG_VIDEO_PATCHING)) {
switch_img_free(&context->patch_img);
switch_img_copy(frame->img, &context->patch_img);
frame->img = context->patch_img;
}
return status;
}
@@ -1326,6 +1333,9 @@ static switch_status_t switch_vpx_destroy(switch_codec_t *codec)
vpx_context_t *context = (vpx_context_t *)codec->private_info;
if (context) {
switch_img_free(&context->patch_img);
if ((codec->flags & SWITCH_CODEC_FLAG_ENCODE)) {
vpx_codec_destroy(&context->encoder);
}