# HG changeset patch
# User rosfran
# Date 1173450351 0
# Node ID 9e1e3e4916c41c2a865e49412ad768ed463bd6ca
# Parent  7d529c58a88f82ac4a4daf3d63b75de74ffc07fc
[svn r414] Fixes unrestricted and continuous reads to movie stream when it is a comoon recorded file.

diff -r 7d529c58a88f -r 9e1e3e4916c4 gmyth/src/gmyth_file_transfer.c
--- a/gmyth/src/gmyth_file_transfer.c	Thu Mar 08 23:55:27 2007 +0000
+++ b/gmyth/src/gmyth_file_transfer.c	Fri Mar 09 14:25:51 2007 +0000
@@ -623,7 +623,7 @@
 	    bytes_sent = gmyth_string_list_get_int( strlist,  0 ); // -1 on backend error
 	    gmyth_debug ( "[%s] got SENT buffer message = %d\n", __FUNCTION__, bytes_sent );
 
-    	if ( bytes_sent >= 0 )
+    	if ( bytes_sent > 0 )
     	{
         gchar *data_buffer = g_new0 ( gchar, bytes_sent );    
    	    while ( 0 != bytes_sent ) 
@@ -639,7 +639,12 @@
 	        gmyth_debug ("Total transfer data read: %d\n", total_read);
         }
         g_free (data_buffer);
-      } /* if */
+      } else if ( bytes_sent <= 0 && !read_unlimited ) {
+      	total_read = GMYTHTV_FILE_TRANSFER_READ_ERROR;
+    		g_object_unref (strlist);
+    		strlist = NULL;
+    		break;
+    	}
     } else if ( !read_unlimited || !(transfer->priv != NULL && transfer->priv->livetv != NULL &&
 					transfer->priv->do_next_program_chain) ) {
     	total_read = GMYTHTV_FILE_TRANSFER_READ_ERROR;