2007-05-22 Tim-Philipp Müller <tim at centricular dot net>
+ Patch by: Mark Nauwelaerts <manauw at skynet be>
+
+ * ext/gnomevfs/gstgnomevfssink.c: (gst_gnome_vfs_sink_init),
+ (gst_gnome_vfs_sink_open_file), (gst_gnome_vfs_sink_handle_event),
+ (gst_gnome_vfs_sink_query), (gst_gnome_vfs_sink_render):
+ * ext/gnomevfs/gstgnomevfssink.h:
+ Fix position reporting, especially after a seek (from upstream),
+ see #412648.
+
+2007-05-22 Tim-Philipp Müller <tim at centricular dot net>
+
* ext/cdparanoia/gstcdparanoiasrc.c:
Repair umlaut.
* 2000 Wim Taymans <wtay@chello.be>
* 2001 Bastien Nocera <hadess@hadess.net>
* 2003 Colin Walters <walters@verbum.org>
- * 2005 Tim-Philipp M??ller <tim centricular net>
+ * 2005 Tim-Philipp Müller <tim centricular net>
*
* gstgnomevfssink.c:
*
sink->uri_name = NULL;
sink->handle = NULL;
sink->own_handle = FALSE;
- sink->data_written = 0;
+ sink->current_pos = 0;
GST_BASE_SINK (sink)->sync = FALSE;
}
sink->own_handle = FALSE;
}
- sink->data_written = 0;
+ sink->current_pos = 0;
return TRUE;
}
if (res != GNOME_VFS_OK) {
GST_ERROR_OBJECT (sink, "Failed to seek to offset %"
G_GINT64_FORMAT ": %s", offset, gnome_vfs_result_to_string (res));
+ } else {
+ sink->current_pos = offset;
}
break;
switch (format) {
case GST_FORMAT_DEFAULT:
case GST_FORMAT_BYTES:
- gst_query_set_position (query, GST_FORMAT_BYTES, sink->data_written);
+ gst_query_set_position (query, GST_FORMAT_BYTES, sink->current_pos);
return TRUE;
default:
return FALSE;
GstGnomeVFSSink *sink;
GnomeVFSResult result;
GstFlowReturn ret;
- guint64 back_pending = 0;
sink = GST_GNOME_VFS_SINK (basesink);
if (gnome_vfs_tell (sink->handle, &cur_pos) == GNOME_VFS_OK) {
- if (cur_pos < sink->data_written)
- back_pending = sink->data_written - cur_pos;
+ /* bring up to date with current position for proper reporting */
+ sink->current_pos = cur_pos;
}
result = gnome_vfs_write (sink->handle, GST_BUFFER_DATA (buf),
GST_BUFFER_SIZE (buf), written);
}
- sink->data_written += GST_BUFFER_SIZE (buf) - back_pending;
+ sink->current_pos += GST_BUFFER_SIZE (buf);
ret = GST_FLOW_OK;
break;
}