1.1 --- a/libgnomevfs2-mythtv/modules/mythtv-method.c Fri Apr 13 20:33:36 2007 +0100
1.2 +++ b/libgnomevfs2-mythtv/modules/mythtv-method.c Tue May 01 16:31:26 2007 +0100
1.3 @@ -60,6 +60,9 @@
1.4 GMythRecorder *live_recorder;
1.5 gboolean started;
1.6 gint64 offset;
1.7 +
1.8 + gboolean is_livetv; /* it is, or not a Live TV content transfer */
1.9 + gboolean is_local_file; /* tell if the file is local to the current content transfer */
1.10
1.11 gchar *channel_name;
1.12
1.13 @@ -98,6 +101,9 @@
1.14
1.15 *method_handle = g_new0 (MythtvHandle, 1);
1.16 (*method_handle)->mythtv_version = MYTHTV_VERSION_DEFAULT;
1.17 +
1.18 + (*method_handle)->is_livetv = FALSE;
1.19 + (*method_handle)->is_local_file = FALSE;
1.20
1.21 tmp_str1 = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
1.22 tmp_str2 = gnome_vfs_unescape_string (tmp_str1, "");
1.23 @@ -188,7 +194,7 @@
1.24 info->name = g_strdup (gmyth_uri_get_path (gmyth_uri));
1.25
1.26 /* file size for remote files */
1.27 - if (gmyth_uri_is_livetv (gmyth_uri) == FALSE) {
1.28 + if ( ( myth_handle->is_livetv = gmyth_uri_is_livetv (gmyth_uri) ) == FALSE) {
1.29 GMythFile *file = NULL;
1.30 gboolean ret = FALSE;
1.31
1.32 @@ -201,7 +207,7 @@
1.33 return GNOME_VFS_ERROR_NOT_FOUND;
1.34 }
1.35
1.36 - if ( gmyth_uri_is_local_file(gmyth_uri) )
1.37 + if ( ( myth_handle->is_local_file = gmyth_uri_is_local_file(gmyth_uri) ) == TRUE )
1.38 {
1.39 file = GMYTH_FILE( gmyth_file_local_new(backend_info) );
1.40 ret = gmyth_file_local_open ( GMYTH_FILE_LOCAL( file ) );
1.41 @@ -237,7 +243,7 @@
1.42 _GNOME_VFS_METHOD_PARAM_CHECK (method_handle->backend_info != NULL);
1.43
1.44 /* Connect to the backend */
1.45 - if (gmyth_uri_is_livetv (method_handle->gmyth_uri) == TRUE) {
1.46 + if ( ( method_handle->is_livetv = gmyth_uri_is_livetv (method_handle->gmyth_uri) ) == TRUE) {
1.47 method_handle->livetv = gmyth_livetv_new (method_handle->backend_info);
1.48 method_handle->channel_name = gmyth_uri_get_channel_name (method_handle->gmyth_uri);
1.49
1.50 @@ -282,7 +288,7 @@
1.51 goto error;
1.52 }
1.53
1.54 - if ( gmyth_uri_is_local_file(method_handle->gmyth_uri) )
1.55 + if ( ( method_handle->is_local_file = gmyth_uri_is_local_file(method_handle->gmyth_uri) ) == TRUE )
1.56 {
1.57 method_handle->file = GMYTH_FILE( gmyth_file_local_new(method_handle->backend_info) );
1.58 ret = gmyth_file_local_open ( GMYTH_FILE_LOCAL( method_handle->file ) );
1.59 @@ -385,15 +391,14 @@
1.60 _GNOME_VFS_METHOD_PARAM_CHECK (method_handle != NULL);
1.61
1.62 myth_handle = (MythtvHandle *) method_handle;
1.63 - if ( gmyth_uri_is_local_file(myth_handle->gmyth_uri) )
1.64 + if ( myth_handle->is_local_file )
1.65 result = gmyth_file_local_read ( GMYTH_FILE_LOCAL(myth_handle->file),
1.66 myth_buffer,
1.67 - num_bytes, gmyth_uri_is_livetv (myth_handle->gmyth_uri));
1.68 + num_bytes, myth_handle->is_livetv );
1.69 else
1.70 result = gmyth_file_transfer_read ( GMYTH_FILE_TRANSFER(myth_handle->file),
1.71 myth_buffer,
1.72 - num_bytes, gmyth_uri_is_livetv (myth_handle->gmyth_uri));
1.73 -
1.74 + num_bytes, myth_handle->is_livetv );
1.75
1.76 if (result == GMYTH_FILE_READ_ERROR) {
1.77 retval = GNOME_VFS_ERROR_IO;