Commit f8604089 authored by Frank Galligan's avatar Frank Galligan Committed by Gerrit Code Review
Browse files

Merge "Fix frames that have no references to them."

parents fffb3be7 1604ad21
......@@ -489,7 +489,7 @@ TEST_P(DatarateTestVP9, BasicRateTargeting2TemporalLayers) {
}
// Check basic rate targeting for 3 temporal layers.
TEST_P(DatarateTestVP9, DISABLED_BasicRateTargeting3TemporalLayers) {
TEST_P(DatarateTestVP9, BasicRateTargeting3TemporalLayers) {
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500;
cfg_.rc_buf_sz = 1000;
......
......@@ -342,6 +342,10 @@ int vp9_receive_compressed_data(VP9D_PTR ptr,
cm->frame_refs[0].buf->corrupted = 1;
}
// Check if the previous frame was a frame without any references to it.
if (cm->new_fb_idx >= 0 && cm->frame_bufs[cm->new_fb_idx].ref_count == 0)
cm->release_fb_cb(cm->cb_priv,
&cm->frame_bufs[cm->new_fb_idx].raw_frame_buffer);
cm->new_fb_idx = get_free_fb(cm);
if (setjmp(cm->error.jmp)) {
......
......@@ -303,6 +303,9 @@ static vpx_codec_err_t decode_one(vpx_codec_alg_priv_t *ctx,
cm->get_fb_cb = vp9_get_frame_buffer;
cm->release_fb_cb = vp9_release_frame_buffer;
// Set index to not initialized.
cm->new_fb_idx = -1;
if (vp9_alloc_internal_frame_buffers(&cm->int_frame_buffers))
vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
"Failed to initialize internal frame buffers");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment