[svn r325] Minor changes, separated process of opening LiveTV FileTransfer from the LiveTV setup. trunk
authorrosfran
Fri Feb 02 22:44:59 2007 +0000 (2007-02-02)
branchtrunk
changeset 3236523ab923c00
parent 322 eb6b0b1409b5
child 324 a14a97093306
[svn r325] Minor changes, separated process of opening LiveTV FileTransfer from the LiveTV setup.
libgnomevfs2-mythtv/modules/mythtv-method.c
     1.1 --- a/libgnomevfs2-mythtv/modules/mythtv-method.c	Fri Feb 02 22:04:00 2007 +0000
     1.2 +++ b/libgnomevfs2-mythtv/modules/mythtv-method.c	Fri Feb 02 22:44:59 2007 +0000
     1.3 @@ -128,6 +128,15 @@
     1.4  	      ret = FALSE;
     1.5  	    }
     1.6  	    
     1.7 +  		if ( !gmyth_file_transfer_open( myth_handle->file_transfer, myth_handle->livetv->uri != NULL ? 
     1.8 +								gmyth_uri_get_path(myth_handle->livetv->uri) : 
     1.9 +								myth_handle->livetv->proginfo->pathname->str ) )
    1.10 +			{
    1.11 +				g_object_unref( myth_handle->file_transfer );
    1.12 +				myth_handle->file_transfer = NULL;
    1.13 +				ret = FALSE;
    1.14 +			}
    1.15 +	    
    1.16  	  } else {
    1.17  	
    1.18  	    myth_handle->file_transfer = gmyth_file_transfer_new (backend_info);
    1.19 @@ -135,7 +144,7 @@
    1.20  	    /* Verifies if the file exists */
    1.21  	    if (!gmyth_util_file_exists (backend_info, gmyth_uri_get_path (gmyth_uri))) {
    1.22  	        g_object_unref (backend_info);
    1.23 -					return GNOME_VFS_ERROR_NOT_FOUND;
    1.24 +					ret = FALSE;
    1.25  	    }
    1.26  	    
    1.27  	    /* sets the Playback monitor connection */
    1.28 @@ -144,9 +153,9 @@
    1.29  	  } /* if - LiveTV or not? */
    1.30  	  
    1.31      if (ret == FALSE) {
    1.32 -	    g_warning ("MythTV FileTransfer open error\n");
    1.33 +	    g_warning ("MythTV FileTransfer open error.\n");
    1.34  	    return GNOME_VFS_ERROR_NOT_OPEN;
    1.35 -	  } 
    1.36 +	  }
    1.37  
    1.38      g_object_unref (backend_info);
    1.39      
    1.40 @@ -154,8 +163,11 @@
    1.41  	  //	g_object_unref( gmyth_uri );
    1.42  	  
    1.43  	  g_return_val_if_fail (myth_handle->file_transfer != NULL, GNOME_VFS_ERROR_NOT_OPEN);
    1.44 -
    1.45 -    myth_handle->content_size = myth_handle->file_transfer->filesize;
    1.46 +	  
    1.47 +	  if ( myth_handle->file_transfer->filesize < 0 && is_livetv )
    1.48 +			myth_handle->content_size = gmyth_recorder_get_file_position( myth_handle->livetv->recorder );
    1.49 +		else		
    1.50 +    	myth_handle->content_size = myth_handle->file_transfer->filesize;
    1.51      
    1.52      myth_handle->buffer = g_byte_array_sized_new (MYTHTV_BUFFER_SIZE);
    1.53      myth_handle->buffer_remain = 0;
    1.54 @@ -344,8 +356,11 @@
    1.55  	    return GNOME_VFS_ERROR_NOT_OPEN;
    1.56  	  }
    1.57  	  */
    1.58 -
    1.59 -    file_info->size = gmyth_file_transfer_get_filesize (file_transfer);
    1.60 +	  if ( file_transfer->filesize < 0 && is_livetv )
    1.61 +			file_info->size = gmyth_recorder_get_file_position( livetv->recorder );
    1.62 +		else		
    1.63 +    	file_info->size = gmyth_file_transfer_get_filesize (file_transfer);
    1.64 +    
    1.65      file_info->block_count = GNOME_VFS_FILE_INFO_FIELDS_BLOCK_COUNT;
    1.66      file_info->io_block_size = GNOME_VFS_FILE_INFO_FIELDS_IO_BLOCK_SIZE;
    1.67