Fix a buffer offset problem in GStreamer 1.16. Initially reported by Mark H. Weaver in . See also . From 1734c9fc1a4f99b165383ae1eb02f04e0844a00c Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Sat, 29 Jun 2019 09:22:05 -0400 Subject: [PATCH] bufferpool: Fix the buffer size reset code The offset in gst_buffer_resize() is additive. So to move back the offset to zero, we need to pass the opposite of the current offset. This was raised through the related unit test failingon 32bit as on 64bit the alignment padding was enough to hide the issue. The test was modified to also fail on 64bit. This patch will remove spurious assertions like: assertion 'bufmax >= bufoffs + offset + size' failed Fixes #316 --- gst/gstbufferpool.c | 7 +++++-- tests/check/gst/gstbufferpool.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gst/gstbufferpool.c b/gst/gstbufferpool.c index e5c7a5872..619860e63 100644 --- a/gst/gstbufferpool.c +++ b/gst/gstbufferpool.c @@ -1222,8 +1222,11 @@ default_reset_buffer (GstBufferPool * pool, GstBuffer * buffer) GST_BUFFER_OFFSET_END (buffer) = GST_BUFFER_OFFSET_NONE; /* if the memory is intact reset the size to the full size */ - if (!GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_TAG_MEMORY)) - gst_buffer_resize (buffer, 0, pool->priv->size); + if (!GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_TAG_MEMORY)) { + gsize offset; + gst_buffer_get_sizes (buffer, &offset, NULL); + gst_buffer_resize (buffer, -offset, pool->priv->size); + } /* remove all metadata without the POOLED flag */ gst_buffer_foreach_meta (buffer, remove_meta_unpooled, pool); diff --git a/tests/check/gst/gstbufferpool.c b/tests/check/gst/gstbufferpool.c index f0c3c8d8e..dd9b2dc03 100644 --- a/tests/check/gst/gstbufferpool.c +++ b/tests/check/gst/gstbufferpool.c @@ -190,7 +190,7 @@ GST_START_TEST (test_buffer_modify_discard) gst_buffer_pool_acquire_buffer (pool, &buf, NULL); buffer_track_destroy (buf, &dcount); /* do resize, as we didn't modify the memory, pool should reuse this buffer */ - gst_buffer_resize (buf, 5, 2); + gst_buffer_resize (buf, 8, 2); gst_buffer_unref (buf); /* buffer should've gone back into pool */ -- 2.22.0 s='content'>
AgeCommit message (Expand)Author
2022-11-20services: mysql: Run mariadb-install-db instead of hard coding schemas....* gnu/services/databases.scm (mysql-install): Run "mariadb-install-db" instead of a hard coded set of SQL commands. (mysql-upgrade-wrapper): Explicitly run as mysql user. Marius Bakke
2022-11-20services: mysql: Remove mysql-install-service in favor of wrapper....* gnu/services/databases.scm (mysql-with-install-lock): Remove variable. (mysql-start): Rename to ... (mysqld-wrapper): ... this. Do the preliminary initialization steps and call out to MYSQL-INSTALL when necessary. (mysql-install): Only initialize table schemas. (mysql-install-shepherd-service): Remove. (mysql-service)[requirement]: Remove 'mysql-install. Add 'user-processes. [start]: Don't pass #:user and #:group. (mysql-shepherd-services): Remove MYSQL-INSTALL-SHEPHERD-SERVICE. Marius Bakke
2022-11-20services: mysql-upgrade: Add log file....* gnu/services/databases.scm (mysql-upgrade-shepherd-service)[start]: Pass #:log-file. Marius Bakke
2022-11-20services: mysql-upgrade: Support custom datadir....* gnu/services/databases.scm (mysql-upgrade-wrapper): Take service configuration as argument, and pass the config file to mysql_upgrade. (mysql-upgrade-shepherd-service): Pass CONFIG instead of just socket and executable to MYSQL-UPGRADE-WRAPPER. Marius Bakke
2022-11-20gnu: mysql: Support custom data dir....* gnu/services/databases.scm (mysql-configuration): Add datadir property. * gnu/services/databases.scm (mysql-configuration-file): Replace hard coded data dir with property from config. * gnu/services/databases.scm (%mysql-activation): Remove activation, it runs before PID 1. The data dir may reside on a file system not mounted at this time. * gnu/services/databases.scm (mysql-install-shepherd-service): Create service which replaces the activation. Provide mysql-install. * gnu/services/databases.scm (mysql-shepherd-service): Move invocation of mysqld to mysql-start program-file, because the invocation gotten more complex. Require mysql-install. * gnu/services/databases.scm (mysql-start): Invoke mysqld only if a lock file appears. * gnu/services/databases.scm (mysql-shepherd-services): Prepend the install service before the normal service. * gnu/services/databases.scm (mysql-upgrade-wrapper): Increase timeout to 20s to let the mysql install procedure finish. Signed-off-by: Marius Bakke <marius@gnu.org> Ellen Papsch