diff -r 997f281ba596 -r b90373d8534b libgnomevfs2-mythtv/modules/mythtv-method.c --- a/libgnomevfs2-mythtv/modules/mythtv-method.c Tue Mar 27 21:43:05 2007 +0100 +++ b/libgnomevfs2-mythtv/modules/mythtv-method.c Thu Apr 05 15:15:12 2007 +0100 @@ -56,6 +56,7 @@ GMythBackendInfo *backend_info; GMythURI *gmyth_uri; GMythRecorder *live_recorder; + gboolean started; gint64 offset; gchar *channel_name; @@ -357,39 +358,36 @@ GnomeVFSFileSize * bytes_read, GnomeVFSContext * context) { - GnomeVFSResult result; + GnomeVFSResult retval = GNOME_VFS_OK; MythtvHandle *myth_handle; - gint64 total_read = 0; + GMythFileTransferReadResult result; GByteArray *myth_buffer = g_byte_array_new (); _GNOME_VFS_METHOD_PARAM_CHECK (method_handle != NULL); myth_handle = (MythtvHandle *) method_handle; - result = GNOME_VFS_OK; + result = gmyth_file_transfer_read (myth_handle->file_transfer, + myth_buffer, + num_bytes, gmyth_uri_is_livetv (myth_handle->gmyth_uri)); - total_read = gmyth_file_transfer_read (myth_handle->file_transfer, - myth_buffer, - num_bytes, gmyth_uri_is_livetv (myth_handle->gmyth_uri)); - - if (total_read == -1) { - result = GNOME_VFS_ERROR_IO; - total_read = 0; + if (result == GMYTH_FILE_TRANSFER_READ_ERROR) { + retval = GNOME_VFS_ERROR_IO; } - if (total_read < num_bytes) { - result = GNOME_VFS_ERROR_EOF; + if (result == GMYTH_FILE_TRANSFER_READ_EOF) { + retval = GNOME_VFS_ERROR_EOF; } - if (total_read > 0) { - g_memmove (buffer, myth_buffer->data, total_read); + if (myth_buffer->len > 0) { + g_memmove (buffer, myth_buffer->data, myth_buffer->len); + *bytes_read = (GnomeVFSFileSize) myth_buffer->len; + myth_handle->offset += myth_buffer->len; g_byte_array_free (myth_buffer, TRUE); - myth_handle->offset += total_read; } - *bytes_read = (GnomeVFSFileSize) total_read; - return result; + return retval; } static GnomeVFSResult