codecs: h264decoder: Fix missing drain handling in bumping
authorSeungha Yang <seungha@centricular.com>
Mon, 9 Nov 2020 14:22:09 +0000 (23:22 +0900)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 9 Nov 2020 14:40:06 +0000 (14:40 +0000)
Should've included in the commit 5527cc4a2e7ce8eeee1d8a717f99252477d6015f

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1783>

gst-libs/gst/codecs/gsth264picture.c

index 6b2a106..f18cd52 100644 (file)
@@ -675,7 +675,7 @@ gst_h264_dpb_bump (GstH264Dpb * dpb, gboolean drain)
 
   /* NOTE: don't use g_array_remove_index_fast here since the last picture
    * need to be referenced for bumping decision */
-  if (!picture->ref)
+  if (!picture->ref || drain)
     g_array_remove_index (dpb->pic_list, index);
 
   dpb->last_output_poc = picture->pic_order_cnt;