From e90ea99df1044c371060f18101f11e17fac3ec10 Mon Sep 17 00:00:00 2001 From: Sreerenj Balachandran Date: Fri, 4 Sep 2015 22:11:10 +0300 Subject: [PATCH] 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 --- gst-libs/gst/vaapi/gstvaapidecoder_h265.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c index ba2ab395dd..460c830138 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c @@ -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; }