From 02fc9a164ad2539502b14e67adeebb02a5ef685e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 19 Jul 2005 11:59:43 +0000 Subject: [PATCH] ext/gnomevfs/gstgnomevfssrc.c: Better debugging. Original commit message from CVS: * ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_create): Better debugging. --- ChangeLog | 5 +++++ ext/gnomevfs/gstgnomevfssrc.c | 32 ++++++++++++++++++++++---------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f657a08b7..82f4bc27df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-07-19 Wim Taymans + + * ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_create): + Better debugging. + 2005-07-19 Wim Taymans * examples/seeking/seek.c: (make_dv_pipeline), diff --git a/ext/gnomevfs/gstgnomevfssrc.c b/ext/gnomevfs/gstgnomevfssrc.c index f6e79bc803..1b73dbf4d9 100644 --- a/ext/gnomevfs/gstgnomevfssrc.c +++ b/ext/gnomevfs/gstgnomevfssrc.c @@ -945,22 +945,20 @@ gst_gnomevfssrc_create (GstBaseSrc * basesrc, guint64 offset, guint size, src = GST_GNOMEVFSSRC (basesrc); + GST_DEBUG ("now at %llu, reading %lld, size %u", src->curoffset, offset, + size); + /* seek if required */ if (src->curoffset != offset) { + GST_DEBUG ("need to seek"); if (src->seekable) { + GST_DEBUG ("seeking to %lld", offset); res = gnome_vfs_seek (src->handle, GNOME_VFS_SEEK_START, offset); - if (res != GNOME_VFS_OK) { - GST_ERROR_OBJECT (src, - "Failed to seek to requested position %lld: %s", - offset, gnome_vfs_result_to_string (res)); - return GST_FLOW_ERROR; - } + if (res != GNOME_VFS_OK) + goto seek_failed; src->curoffset = offset; } else { - GST_ERROR_OBJECT (src, - "Requested seek from %lld to %lld on non-seekable stream", - src->curoffset, offset); - return GST_FLOW_ERROR; + goto cannot_seek; } } @@ -1017,6 +1015,20 @@ gst_gnomevfssrc_create (GstBaseSrc * basesrc, guint64 offset, guint size, return GST_FLOW_OK; +seek_failed: + { + GST_ERROR_OBJECT (src, + "Failed to seek to requested position %lld: %s", + offset, gnome_vfs_result_to_string (res)); + return GST_FLOW_ERROR; + } +cannot_seek: + { + GST_ERROR_OBJECT (src, + "Requested seek from %lld to %lld on non-seekable stream", + src->curoffset, offset); + return GST_FLOW_ERROR; + } read_failed: { gst_buffer_unref (buf);