[svn r414] Fixes unrestricted and continuous reads to movie stream when it is a comoon recorded file. trunk
authorrosfran
Fri Mar 09 14:25:51 2007 +0000 (2007-03-09)
branchtrunk
changeset 4099e1e3e4916c4
parent 408 7d529c58a88f
child 410 7b062aa36323
[svn r414] Fixes unrestricted and continuous reads to movie stream when it is a comoon recorded file.
gmyth/src/gmyth_file_transfer.c
     1.1 --- a/gmyth/src/gmyth_file_transfer.c	Thu Mar 08 23:55:27 2007 +0000
     1.2 +++ b/gmyth/src/gmyth_file_transfer.c	Fri Mar 09 14:25:51 2007 +0000
     1.3 @@ -623,7 +623,7 @@
     1.4  	    bytes_sent = gmyth_string_list_get_int( strlist,  0 ); // -1 on backend error
     1.5  	    gmyth_debug ( "[%s] got SENT buffer message = %d\n", __FUNCTION__, bytes_sent );
     1.6  
     1.7 -    	if ( bytes_sent >= 0 )
     1.8 +    	if ( bytes_sent > 0 )
     1.9      	{
    1.10          gchar *data_buffer = g_new0 ( gchar, bytes_sent );    
    1.11     	    while ( 0 != bytes_sent ) 
    1.12 @@ -639,7 +639,12 @@
    1.13  	        gmyth_debug ("Total transfer data read: %d\n", total_read);
    1.14          }
    1.15          g_free (data_buffer);
    1.16 -      } /* if */
    1.17 +      } else if ( bytes_sent <= 0 && !read_unlimited ) {
    1.18 +      	total_read = GMYTHTV_FILE_TRANSFER_READ_ERROR;
    1.19 +    		g_object_unref (strlist);
    1.20 +    		strlist = NULL;
    1.21 +    		break;
    1.22 +    	}
    1.23      } else if ( !read_unlimited || !(transfer->priv != NULL && transfer->priv->livetv != NULL &&
    1.24  					transfer->priv->do_next_program_chain) ) {
    1.25      	total_read = GMYTHTV_FILE_TRANSFER_READ_ERROR;