libs: encoder: h264: initialize all elements of view_ids
authorHyunjun Ko <zzoon@igalia.com>
Thu, 29 Jun 2017 03:50:26 +0000 (12:50 +0900)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Tue, 4 Jul 2017 11:27:56 +0000 (13:27 +0200)
Currently when num_views is changed by multiview-mode on sink caps, it produces
wrong MVC encoded stream since the array view_ids is not set properly according
to changed num_views.

So this patch initializes all of the array sequentially to handle this case.
Side effect is not going to happen by this patch since this array is being
handled by num_views.

https://bugzilla.gnome.org/show_bug.cgi?id=784321

gst-libs/gst/vaapi/gstvaapiencoder_h264.c

index b93bafe..fda0c31 100644 (file)
@@ -2971,7 +2971,7 @@ gst_vaapi_encoder_h264_set_property (GstVaapiEncoder * base_encoder,
       GValueArray *view_ids = g_value_get_boxed (value);
 
       if (view_ids == NULL) {
-        for (i = 0; i < encoder->num_views; i++)
+        for (i = 0; i < MAX_NUM_VIEWS; i++)
           encoder->view_ids[i] = i;
       } else {
         g_assert (view_ids->n_values <= encoder->num_views);