diff --git a/gst/gstbufferpool.c b/gst/gstbufferpool.c index eaf434b47d..60cc77ca38 100644 --- a/gst/gstbufferpool.c +++ b/gst/gstbufferpool.c @@ -1049,9 +1049,11 @@ gst_buffer_pool_config_get_allocator (GstStructure * config, * Validate that changes made to @config are still valid in the context of the * expected parameters. This function is a helper that can be used to validate * changes made by a pool to a config when gst_buffer_pool_set_config() - * returns %FALSE. This expects that @caps and @size haven't changed, and that - * @min_buffers aren't lower then what we initially expected. This does not check - * if options or allocator parameters. + * returns %FALSE. This expects that @caps haven't changed and that + * @min_buffers aren't lower then what we initially expected. + * This does not check if options or allocator parameters are still valid, + * won't check if size have changed, since changing the size is valid to adapt + * padding. * * Since: 1.4 * @@ -1069,7 +1071,7 @@ gst_buffer_pool_config_validate_params (GstStructure * config, GstCaps * caps, gst_buffer_pool_config_get_params (config, &newcaps, &newsize, &newmin, NULL); - if (gst_caps_is_equal (caps, newcaps) && (size == newsize) + if (gst_caps_is_equal (caps, newcaps) && (newsize >= size) && (newmin >= min_buffers)) ret = TRUE; diff --git a/tests/check/gst/gstbufferpool.c b/tests/check/gst/gstbufferpool.c index 7dcf1bf5d6..96769cb93b 100644 --- a/tests/check/gst/gstbufferpool.c +++ b/tests/check/gst/gstbufferpool.c @@ -228,8 +228,8 @@ GST_START_TEST (test_pool_config_validate) fail_unless (gst_buffer_pool_config_validate_params (config, caps, 5, 4, 0)); fail_unless (gst_buffer_pool_config_validate_params (config, caps, 5, 2, 0)); + fail_unless (gst_buffer_pool_config_validate_params (config, caps, 4, 4, 0)); fail_if (gst_buffer_pool_config_validate_params (config, caps, 5, 6, 0)); - fail_if (gst_buffer_pool_config_validate_params (config, caps, 4, 4, 0)); gst_caps_unref (caps); caps = gst_caps_new_empty_simple ("test/data2");