diff -r 3b575d136efe -r a14a97093306 libgnomevfs2-mythtv/modules/mythtv-method.c --- a/libgnomevfs2-mythtv/modules/mythtv-method.c Wed Jan 31 21:44:45 2007 +0000 +++ b/libgnomevfs2-mythtv/modules/mythtv-method.c Fri Feb 02 22:45:47 2007 +0000 @@ -128,6 +128,15 @@ ret = FALSE; } + if ( !gmyth_file_transfer_open( myth_handle->file_transfer, myth_handle->livetv->uri != NULL ? + gmyth_uri_get_path(myth_handle->livetv->uri) : + myth_handle->livetv->proginfo->pathname->str ) ) + { + g_object_unref( myth_handle->file_transfer ); + myth_handle->file_transfer = NULL; + ret = FALSE; + } + } else { myth_handle->file_transfer = gmyth_file_transfer_new (backend_info); @@ -135,7 +144,7 @@ /* Verifies if the file exists */ if (!gmyth_util_file_exists (backend_info, gmyth_uri_get_path (gmyth_uri))) { g_object_unref (backend_info); - return GNOME_VFS_ERROR_NOT_FOUND; + ret = FALSE; } /* sets the Playback monitor connection */ @@ -144,9 +153,9 @@ } /* if - LiveTV or not? */ if (ret == FALSE) { - g_warning ("MythTV FileTransfer open error\n"); + g_warning ("MythTV FileTransfer open error.\n"); return GNOME_VFS_ERROR_NOT_OPEN; - } + } g_object_unref (backend_info); @@ -154,8 +163,11 @@ // g_object_unref( gmyth_uri ); g_return_val_if_fail (myth_handle->file_transfer != NULL, GNOME_VFS_ERROR_NOT_OPEN); - - myth_handle->content_size = myth_handle->file_transfer->filesize; + + if ( myth_handle->file_transfer->filesize < 0 && is_livetv ) + myth_handle->content_size = gmyth_recorder_get_file_position( myth_handle->livetv->recorder ); + else + myth_handle->content_size = myth_handle->file_transfer->filesize; myth_handle->buffer = g_byte_array_sized_new (MYTHTV_BUFFER_SIZE); myth_handle->buffer_remain = 0; @@ -344,8 +356,11 @@ return GNOME_VFS_ERROR_NOT_OPEN; } */ - - file_info->size = gmyth_file_transfer_get_filesize (file_transfer); + if ( file_transfer->filesize < 0 && is_livetv ) + file_info->size = gmyth_recorder_get_file_position( livetv->recorder ); + else + file_info->size = gmyth_file_transfer_get_filesize (file_transfer); + file_info->block_count = GNOME_VFS_FILE_INFO_FIELDS_BLOCK_COUNT; file_info->io_block_size = GNOME_VFS_FILE_INFO_FIELDS_IO_BLOCK_SIZE;