From 035045c981d6db02da015b445013e23a6ee55c18 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 17 Aug 2018 17:24:19 +0300 Subject: [PATCH] filesink: Consider the current buffer size when checking the current position --- plugins/elements/gstfilesink.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/elements/gstfilesink.c b/plugins/elements/gstfilesink.c index c328a2b..e01c0e5 100644 --- a/plugins/elements/gstfilesink.c +++ b/plugins/elements/gstfilesink.c @@ -452,7 +452,8 @@ gst_file_sink_query (GstBaseSink * bsink, GstQuery * query) switch (format) { case GST_FORMAT_DEFAULT: case GST_FORMAT_BYTES: - gst_query_set_position (query, GST_FORMAT_BYTES, self->current_pos); + gst_query_set_position (query, GST_FORMAT_BYTES, + self->current_pos + self->current_buffer_size); res = TRUE; break; default: @@ -557,7 +558,8 @@ gst_file_sink_event (GstBaseSink * sink, GstEvent * event) if (segment->format == GST_FORMAT_BYTES) { /* only try to seek and fail when we are going to a different * position */ - if (filesink->current_pos != segment->start) { + if (filesink->current_pos + filesink->current_buffer_size != + segment->start) { /* FIXME, the seek should be performed on the pos field, start/stop are * just boundaries for valid bytes offsets. We should also fill the file * with zeroes if the new position extends the current EOF (sparse streams -- 2.7.4