decoder: h264: fix inter-view references array growth.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Fri, 6 Jun 2014 15:56:06 +0000 (17:56 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Fri, 6 Jun 2014 15:58:50 +0000 (17:58 +0200)
Let the utility layer handle dynamic growth of the inter-view pictures
array. By definition, setting a new size to the array will effectively
grow the array, but would also fill in the newly created elements with
empty entries (NULL), thus also increasing the reported length, which
is not correct.

gst-libs/gst/vaapi/gstvaapidecoder_h264.c

index cfe7b026cd30544aa72d313a3875dad523b27ef3..1ce29833fd0b2e6c837b3ea3c22c7ffd8e5db916 100644 (file)
@@ -977,9 +977,7 @@ mvc_reset(GstVaapiDecoderH264 *decoder)
     guint i;
 
     // Resize array of inter-view references
-    if (priv->inter_views)
-        g_ptr_array_set_size(priv->inter_views, priv->max_views);
-    else {
+    if (!priv->inter_views) {
         priv->inter_views = g_ptr_array_new_full(priv->max_views,
             (GDestroyNotify)unref_inter_view);
         if (!priv->inter_views)