diff -r 60c1efd70423 -r 81f031485b52 libgnomevfs2-mythtv/modules/mythtv-method.c --- a/libgnomevfs2-mythtv/modules/mythtv-method.c Fri Apr 13 20:33:36 2007 +0100 +++ b/libgnomevfs2-mythtv/modules/mythtv-method.c Tue May 01 17:22:20 2007 +0100 @@ -60,6 +60,9 @@ GMythRecorder *live_recorder; gboolean started; gint64 offset; + + gboolean is_livetv; /* it is, or not a Live TV content transfer */ + gboolean is_local_file; /* tell if the file is local to the current content transfer */ gchar *channel_name; @@ -98,6 +101,9 @@ *method_handle = g_new0 (MythtvHandle, 1); (*method_handle)->mythtv_version = MYTHTV_VERSION_DEFAULT; + + (*method_handle)->is_livetv = FALSE; + (*method_handle)->is_local_file = FALSE; tmp_str1 = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE); tmp_str2 = gnome_vfs_unescape_string (tmp_str1, ""); @@ -188,7 +194,7 @@ info->name = g_strdup (gmyth_uri_get_path (gmyth_uri)); /* file size for remote files */ - if (gmyth_uri_is_livetv (gmyth_uri) == FALSE) { + if ( ( myth_handle->is_livetv = gmyth_uri_is_livetv (gmyth_uri) ) == FALSE) { GMythFile *file = NULL; gboolean ret = FALSE; @@ -201,7 +207,7 @@ return GNOME_VFS_ERROR_NOT_FOUND; } - if ( gmyth_uri_is_local_file(gmyth_uri) ) + if ( ( myth_handle->is_local_file = gmyth_uri_is_local_file(gmyth_uri) ) == TRUE ) { file = GMYTH_FILE( gmyth_file_local_new(backend_info) ); ret = gmyth_file_local_open ( GMYTH_FILE_LOCAL( file ) ); @@ -237,7 +243,7 @@ _GNOME_VFS_METHOD_PARAM_CHECK (method_handle->backend_info != NULL); /* Connect to the backend */ - if (gmyth_uri_is_livetv (method_handle->gmyth_uri) == TRUE) { + if ( ( method_handle->is_livetv = gmyth_uri_is_livetv (method_handle->gmyth_uri) ) == TRUE) { method_handle->livetv = gmyth_livetv_new (method_handle->backend_info); method_handle->channel_name = gmyth_uri_get_channel_name (method_handle->gmyth_uri); @@ -282,7 +288,7 @@ goto error; } - if ( gmyth_uri_is_local_file(method_handle->gmyth_uri) ) + if ( ( method_handle->is_local_file = gmyth_uri_is_local_file(method_handle->gmyth_uri) ) == TRUE ) { method_handle->file = GMYTH_FILE( gmyth_file_local_new(method_handle->backend_info) ); ret = gmyth_file_local_open ( GMYTH_FILE_LOCAL( method_handle->file ) ); @@ -385,15 +391,14 @@ _GNOME_VFS_METHOD_PARAM_CHECK (method_handle != NULL); myth_handle = (MythtvHandle *) method_handle; - if ( gmyth_uri_is_local_file(myth_handle->gmyth_uri) ) + if ( myth_handle->is_local_file ) result = gmyth_file_local_read ( GMYTH_FILE_LOCAL(myth_handle->file), myth_buffer, - num_bytes, gmyth_uri_is_livetv (myth_handle->gmyth_uri)); + num_bytes, myth_handle->is_livetv ); else result = gmyth_file_transfer_read ( GMYTH_FILE_TRANSFER(myth_handle->file), myth_buffer, - num_bytes, gmyth_uri_is_livetv (myth_handle->gmyth_uri)); - + num_bytes, myth_handle->is_livetv ); if (result == GMYTH_FILE_READ_ERROR) { retval = GNOME_VFS_ERROR_IO;