From b051285e03486ab134e6d01ff49be54884975a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 18 Aug 2025 14:13:55 +0300 Subject: [PATCH] python: Handle buffer PTS/DTS/duration/offset/offset-end as unsigned long long Previously these fields were truncated to 32 bits on 32 bit platforms and 64 bit Windows because of using `unsigned long`. Thanks to Tim Williams for reporting and debugging this issue. Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4603 Part-of: --- subprojects/gst-python/gi/overrides/gstmodule.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/subprojects/gst-python/gi/overrides/gstmodule.c b/subprojects/gst-python/gi/overrides/gstmodule.c index 4ff5cc429d86..72431421d591 100644 --- a/subprojects/gst-python/gi/overrides/gstmodule.c +++ b/subprojects/gst-python/gi/overrides/gstmodule.c @@ -1431,7 +1431,7 @@ _gst_buffer_get_dts (PyObject * self, PyObject * args) { DECLARE_BUFFER (args); - return PyLong_FromUnsignedLong (buffer->dts); + return PyLong_FromUnsignedLongLong (buffer->dts); } static gboolean @@ -1485,7 +1485,7 @@ _gst_buffer_get_pts (PyObject * self, PyObject * args) { DECLARE_BUFFER (args); - return PyLong_FromUnsignedLong (buffer->pts); + return PyLong_FromUnsignedLongLong (buffer->pts); } static PyObject * @@ -1516,7 +1516,7 @@ _gst_buffer_get_duration (PyObject * self, PyObject * args) { DECLARE_BUFFER (args); - return PyLong_FromUnsignedLong (buffer->duration); + return PyLong_FromUnsignedLongLong (buffer->duration); } static PyObject * @@ -1547,7 +1547,7 @@ _gst_buffer_get_offset (PyObject * self, PyObject * args) { DECLARE_BUFFER (args); - return PyLong_FromUnsignedLong (buffer->offset); + return PyLong_FromUnsignedLongLong (buffer->offset); } static PyObject * @@ -1578,7 +1578,7 @@ _gst_buffer_get_offset_end (PyObject * self, PyObject * args) { DECLARE_BUFFER (args); - return PyLong_FromUnsignedLong (buffer->offset_end); + return PyLong_FromUnsignedLongLong (buffer->offset_end); } static PyObject * -- GitLab