Index: gstgnomevfssrc.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/ext/gnomevfs/gstgnomevfssrc.c,v
retrieving revision 1.105
diff -u -p -r1.105 gstgnomevfssrc.c
--- gstgnomevfssrc.c	20 May 2008 11:13:26 -0000	1.105
+++ gstgnomevfssrc.c	9 Jun 2008 10:51:01 -0000
@@ -609,6 +633,7 @@ gst_gnome_vfs_src_create (GstBaseSrc * b
   GstBuffer *buf;
   GnomeVFSFileSize readbytes;
   guint8 *data;
+  guint todo;
   GstGnomeVFSSrc *src;
 
   src = GST_GNOME_VFS_SRC (basesrc);
@@ -620,7 +645,7 @@ gst_gnome_vfs_src_create (GstBaseSrc * b
   if (G_UNLIKELY (src->curoffset != offset)) {
     GST_DEBUG ("need to seek");
     if (src->seekable) {
-      GST_DEBUG ("seeking to %lld", offset);
+      GST_DEBUG ("seeking to %" G_GUINT64_FORMAT, offset);
       res = gnome_vfs_seek (src->handle, GNOME_VFS_SEEK_START, offset);
       if (res != GNOME_VFS_OK)
         goto seek_failed;
@@ -633,20 +658,30 @@ gst_gnome_vfs_src_create (GstBaseSrc * b
   buf = gst_buffer_new_and_alloc (size);
 
   data = GST_BUFFER_DATA (buf);
-  GST_BUFFER_OFFSET (buf) = src->curoffset;
-
-  res = gnome_vfs_read (src->handle, data, size, &readbytes);
 
-  if (G_UNLIKELY (res == GNOME_VFS_ERROR_EOF || (res == GNOME_VFS_OK
-              && readbytes == 0)))
-    goto eos;
-
-  GST_BUFFER_SIZE (buf) = readbytes;
-
-  if (G_UNLIKELY (res != GNOME_VFS_OK))
-    goto read_failed;
-
-  src->curoffset += readbytes;
+  todo = size;
+  while (todo > 0) {
+    /* this can return less that we ask for */
+    res = gnome_vfs_read (src->handle, data, todo, &readbytes);
+
+    if (G_UNLIKELY (res == GNOME_VFS_ERROR_EOF || (res == GNOME_VFS_OK
+                && readbytes == 0)))
+      goto eos;
+  
+    if (G_UNLIKELY (res != GNOME_VFS_OK))
+      goto read_failed;
+
+    if(readbytes < todo) {
+      data = &data[readbytes];
+      todo -= readbytes;
+    }
+    else {
+      todo = 0;
+    }
+    GST_LOG ("  got size %" G_GUINT64_FORMAT, readbytes);
+  }
+  GST_BUFFER_OFFSET (buf) = src->curoffset;
+  src->curoffset += size;
 
   /* we're done, return the buffer */
   *buffer = buf;

