# HG changeset patch
# User rosfran
# Date 1173305715 0
# Node ID 918644a591067194d8cbf29e0b046a34fa2946e1
# Parent  e35c8369c0759171e30c28976265e076968e9a62
[svn r404] Some fixes on the MythTV backend messages from LiveTV.

diff -r e35c8369c075 -r 918644a59106 gmyth/src/gmyth_http.c
--- a/gmyth/src/gmyth_http.c	Wed Mar 07 16:50:11 2007 +0000
+++ b/gmyth/src/gmyth_http.c	Wed Mar 07 22:15:15 2007 +0000
@@ -253,9 +253,9 @@
     endtime = gmyth_util_time_to_mythformat_from_time_val(EndTime);
 
     GString* command = g_string_new("");
-    g_string_printf(command, "getProgramGuide?StartTime=%s&EndTime=%s&StartChanId=%d"
+    g_string_printf(command, "getProgramGuide?StartTime=%s&EndTime=%s&StartChanId=%d" \
             "&NumOfChannels=%d&Details=%s", starttime, endtime, \
-            StartChanId, NumOfChannels, Details);
+            StartChanId, NumOfChannels, Details );
 
     chunk = gmyth_http_request(backend_info, command);
     if (chunk.memory != NULL)
diff -r e35c8369c075 -r 918644a59106 gmyth/src/gmyth_livetv.c
--- a/gmyth/src/gmyth_livetv.c	Wed Mar 07 16:50:11 2007 +0000
+++ b/gmyth/src/gmyth_livetv.c	Wed Mar 07 22:15:15 2007 +0000
@@ -199,6 +199,7 @@
 				} else
 					gmyth_debug( "LIVETV file_transfer is NULL!!! Cannot move to the next program chain event received.\n");				
 			}
+			break;
 		}
 		case GMYTH_BACKEND_DONE_RECORDING:
 		{
@@ -224,6 +225,7 @@
 				} else
 					gmyth_debug( "LIVETV file_transfer is NULL!!! Cannot move to the next program chain event received.\n");				
 			}
+			break;
 		}
 		case GMYTH_BACKEND_STOP_LIVETV:
 		{
@@ -399,7 +401,7 @@
 
     while (wait_to_transfer++ < GMYTHTV_TRANSFER_MAX_WAITS &&
         (gmyth_recorder_is_recording (livetv->recorder) == FALSE))
-      g_usleep (800);
+      g_usleep (300);
 
 		if ( channel != NULL ) 
 		{
@@ -421,7 +423,7 @@
 	
 		} /* if - changes the channel number */
 		
-    sleep (2);                  /* FIXME: this is evil (tpm) */
+    sleep (6);                  /* FIXME: this is evil (tpm) */
   }
   
   /* DEBUG message */  
@@ -703,7 +705,7 @@
     goto done;
   }
   
-  gmyth_file_transfer_settimeout( livetv->file_transfer, TRUE );
+  //gmyth_file_transfer_settimeout( livetv->file_transfer, TRUE );
 	
 	g_mutex_unlock( livetv->mutex );
 
diff -r e35c8369c075 -r 918644a59106 gmyth/src/gmyth_util.c
--- a/gmyth/src/gmyth_util.c	Wed Mar 07 16:50:11 2007 +0000
+++ b/gmyth/src/gmyth_util.c	Wed Mar 07 22:15:15 2007 +0000
@@ -104,14 +104,15 @@
 {
 	gchar *result = NULL;
 	struct tm *tm_time = NULL;
+	time_t time;
 	
 	gint buffer_len = 0;
 	
 	g_return_val_if_fail( fmt_string != NULL, NULL );
 		
 	g_return_val_if_fail( time_val != NULL, NULL );
- 
-	time_t time = time_val->tv_sec;// + (gint)( time_val->tv_usec / G_USEC_PER_SEC );
+
+	time = time_val->tv_sec;// + (gint)( time_val->tv_usec / G_USEC_PER_SEC );
 
 	tm_time = g_malloc0( sizeof(struct tm) );
 
@@ -120,7 +121,8 @@
 	if ( NULL == localtime_r( &time, tm_time ) ) {
 		g_warning ("gmyth_util_time_to_isoformat convertion error!\n");
 	}	else {
-		// we first check the return of strftime to allocate a buffer of the correct size
+		
+		/* we first check the return of strftime to allocate a buffer of the correct size */
 	  buffer_len = strftime( NULL, SSIZE_MAX, fmt_string, tm_time );
 	  if ( buffer_len > 0 ) {
 	    result = g_malloc0( buffer_len + 1 );
@@ -133,7 +135,7 @@
 	    gmyth_debug( "Dateline (ISO result): %s", result );
 	  }
 		
-	}
+	} /* if */
 	
 	gmyth_debug( "Result (strftime) = %s", result );