decoder: hevc: Fix the dpb_add() based on C.5.2.3

Follow the spec as it is in C.5.2.3, add the decoded frame to dpb
just after the PicLatencyCnt setting of existing dpb frames.

https://bugzilla.gnome.org/show_bug.cgi?id=754010
This commit is contained in:
Sreerenj Balachandran 2015-09-04 22:11:10 +03:00
parent 8799a8044d
commit e90ea99df1

View file

@ -826,6 +826,13 @@ dpb_add (GstVaapiDecoderH265 * decoder, GstVaapiPictureH265 * picture)
}
}
/* Create new frame store */
fs = gst_vaapi_frame_store_new (picture);
if (!fs)
return FALSE;
gst_vaapi_frame_store_replace (&priv->dpb[priv->dpb_count++], fs);
gst_vaapi_frame_store_unref (fs);
if (picture->output_flag) {
picture->output_needed = 1;
picture->pic_latency_cnt = 0;
@ -843,13 +850,6 @@ dpb_add (GstVaapiDecoderH265 * decoder, GstVaapiPictureH265 * picture)
&& check_latency_cnt (decoder)))
dpb_bump (decoder, picture);
/* Create new frame store */
fs = gst_vaapi_frame_store_new (picture);
if (!fs)
return FALSE;
gst_vaapi_frame_store_replace (&priv->dpb[priv->dpb_count++], fs);
gst_vaapi_frame_store_unref (fs);
return TRUE;
}