libgnomevfs2-mythtv/modules/mythtv-method.c
branchtrunk
changeset 290 96b436a81e53
parent 281 08c4bc759e7a
child 294 388fc8b452c2
     1.1 --- a/libgnomevfs2-mythtv/modules/mythtv-method.c	Fri Jan 19 18:39:37 2007 +0000
     1.2 +++ b/libgnomevfs2-mythtv/modules/mythtv-method.c	Mon Jan 22 21:22:55 2007 +0000
     1.3 @@ -151,20 +151,6 @@
     1.4  	    g_warning ("MythTV FileTransfer open error\n");
     1.5  	    return GNOME_VFS_ERROR_NOT_OPEN;
     1.6  	  } 
     1.7 -	
     1.8 -	  if ( is_livetv == TRUE && ret == TRUE ) {
     1.9 -	    /* loop finished, set the max tries variable to zero again... */
    1.10 -	    wait_to_transfer = 0;
    1.11 -	
    1.12 -	    while ( wait_to_transfer++ < MYTHTV_TRANSFER_MAX_WAITS &&
    1.13 -	        (gmyth_livetv_is_recording (myth_handle->livetv) == FALSE))
    1.14 -	      g_usleep (500);
    1.15 -	
    1.16 -	    /* IS_RECORDING again, just like the MythTV backend does... */
    1.17 -	    gmyth_livetv_is_recording (myth_handle->livetv);
    1.18 -	
    1.19 -	    sleep (4);                  /* FIXME: this is evil (tpm) */
    1.20 -	  }
    1.21  
    1.22      g_object_unref (backend_info);
    1.23  
    1.24 @@ -204,8 +190,8 @@
    1.25  
    1.26      /* Loop sending the Myth File Transfer request:
    1.27      * Retry whilst authentication fails and we supply it. */
    1.28 -  
    1.29 -    if ( bytes_to_read > myth_handle->buffer_remain ) {
    1.30 +    if ((myth_handle->buffer_remain = myth_handle->buffer->len) < MYTHTV_BUFFER_SIZE) {
    1.31 +    //if ( bytes_to_read > myth_handle->buffer_remain ) {
    1.32          GByteArray *tmp_buffer = g_byte_array_new();
    1.33  
    1.34          gint len = gmyth_file_transfer_read (myth_handle->file_transfer,
    1.35 @@ -215,11 +201,11 @@
    1.36              g_byte_array_free (tmp_buffer, TRUE);
    1.37              g_warning ("Fail to read bytes");
    1.38  	    return GNOME_VFS_ERROR_IO;
    1.39 -        } else if (len == 0) {
    1.40 +        } /*else if (len == 0) {
    1.41  	    g_byte_array_free (tmp_buffer, TRUE);
    1.42  	    g_warning ("End of file probably achieved");
    1.43  	    return GNOME_VFS_ERROR_EOF;
    1.44 -	}
    1.45 +	}*/
    1.46  
    1.47          myth_handle->buffer = g_byte_array_append (myth_handle->buffer,
    1.48      		tmp_buffer->data, len);