[svn r328] Some fixes on program info, and some memory clean ups. trunk
authorrosfran
Tue Feb 06 00:33:35 2007 +0000 (2007-02-06)
branchtrunk
changeset 32681b1f3006eb2
parent 325 b6b5f2dc831d
child 327 41995e0df2ba
[svn r328] Some fixes on program info, and some memory clean ups.
gmyth/src/gmyth_livetv.c
gmyth/src/gmyth_programinfo.c
gmyth/src/gmyth_tvchain.c
     1.1 --- a/gmyth/src/gmyth_livetv.c	Fri Feb 02 22:46:13 2007 +0000
     1.2 +++ b/gmyth/src/gmyth_livetv.c	Tue Feb 06 00:33:35 2007 +0000
     1.3 @@ -259,8 +259,7 @@
     1.4    	livetv->monitor = NULL;
     1.5    } 
     1.6    
     1.7 -}  
     1.8 -
     1.9 +}
    1.10  
    1.11  /*
    1.12  static gchar*
    1.13 @@ -276,7 +275,8 @@
    1.14  */
    1.15  
    1.16  static gboolean
    1.17 -gmyth_livetv_setup_recorder_channel_name ( GMythLiveTV *livetv, gchar* channel, GMythBackendInfo *backend_info )
    1.18 +gmyth_livetv_setup_recorder_channel_name ( GMythLiveTV *livetv, gchar* channel, 
    1.19 +			GMythBackendInfo *backend_info )
    1.20  {
    1.21  	gboolean res = TRUE;
    1.22  
    1.23 @@ -286,7 +286,7 @@
    1.24  	
    1.25  	g_static_mutex_lock( &lock );
    1.26  
    1.27 -	// FIME: Implement this at gmyth_socket
    1.28 +	/* FIME: Implement this at gmyth_socket */
    1.29  	res = gmyth_socket_connect_to_backend (socket, livetv->backend_info->hostname,
    1.30  			livetv->backend_info->port, TRUE);
    1.31  	if (!res) {
    1.32 @@ -320,7 +320,7 @@
    1.33  		goto error;
    1.34  	}
    1.35  	
    1.36 -	// Init remote encoder. Opens its control socket.
    1.37 +	/* Init remote encoder. Opens its control socket. */
    1.38  	res = gmyth_recorder_setup(livetv->recorder);
    1.39  	if ( !res ) {
    1.40  		g_warning ("[%s] Fail while setting remote encoder\n", __FUNCTION__);
    1.41 @@ -328,7 +328,7 @@
    1.42  		goto error;
    1.43  	}
    1.44  	
    1.45 -	// Creates livetv chain handler
    1.46 +	/* Creates livetv chain handler */
    1.47  	livetv->tvchain = GMYTH_TVCHAIN ( g_object_new(GMYTH_TVCHAIN_TYPE, NULL) );
    1.48  	gmyth_tvchain_initialize ( livetv->tvchain, livetv->backend_info );
    1.49  
    1.50 @@ -371,11 +371,11 @@
    1.51  	  	{
    1.52  		  	if ( gmyth_recorder_set_channel_name( livetv->recorder, channel ) )
    1.53  		  	{
    1.54 -		  		g_print( "[%s] Channel changed!!! [%s].\n", __FUNCTION__, channel );
    1.55 +		  		gmyth_debug( "Channel changed!!! [%s].\n", channel );
    1.56  		  	}
    1.57  	  	}
    1.58  	
    1.59 -		}
    1.60 +		} /* if - changes the channel number */
    1.61  		
    1.62      sleep (9);                  /* FIXME: this is evil (tpm) */
    1.63    }
    1.64 @@ -390,7 +390,7 @@
    1.65      gint i;
    1.66      gchar *channame = NULL;
    1.67  
    1.68 -    fprintf(stderr, "problem getting current proginfo!\n");
    1.69 +    gmyth_debug( "Problem getting current proginfo!\n" );
    1.70  
    1.71      /*
    1.72       * mythbackend must not be tuned in to a channel, so keep
    1.73 @@ -408,8 +408,9 @@
    1.74        if (prog_info != NULL)
    1.75        	break;
    1.76      }
    1.77 -		
    1.78 -	}
    1.79 +
    1.80 +	} /* if - Program Info */
    1.81 +	
    1.82  	/* prints program info data text */ 
    1.83  	gmyth_debug( "New ProgramInfo...\n" );
    1.84  	gmyth_program_info_print( prog_info );
    1.85 @@ -417,10 +418,12 @@
    1.86  	gmyth_debug( "Old ProgramInfo...\n" );
    1.87  	gmyth_program_info_print( livetv->proginfo );
    1.88  	
    1.89 +	/*
    1.90  	GMythProgramInfo* prog_inf = gmyth_recorder_get_next_program_info( livetv->recorder, BROWSE_DIRECTION_UP );
    1.91  	
    1.92  	gmyth_debug( "Next ProgramInfo...\n" );
    1.93  	gmyth_program_info_print( prog_inf );
    1.94 +	*/
    1.95  	
    1.96  	/* check if the program chain could be obtained from the MythTV protocol message */
    1.97  	if ( prog_info != NULL )
     2.1 --- a/gmyth/src/gmyth_programinfo.c	Fri Feb 02 22:46:13 2007 +0000
     2.2 +++ b/gmyth/src/gmyth_programinfo.c	Tue Feb 06 00:33:35 2007 +0000
     2.3 @@ -309,25 +309,25 @@
     2.4      gmyth_string_list_append_string (slist, prog->chansign); /* 6 */
     2.5      gmyth_string_list_append_string (slist, prog->channame); /* 7 */
     2.6      gmyth_string_list_append_string (slist, prog->pathname); /* 8 */
     2.7 -    gmyth_string_list_append_int (slist, 0); /* 11 */
     2.8 +    gmyth_string_list_append_int (slist, 0); /* 9 */
     2.9  
    2.10      // fixme
    2.11      //gmyth_string_list_append_int64 (slist, 100/*prog->filesize*/); /* 9 */
    2.12 -    gmyth_string_list_append_int64 (slist, 0); /* 11 */
    2.13 +    //gmyth_string_list_append_int (slist, 0); /* 10 */
    2.14  
    2.15      if (prog->startts)
    2.16 -        gmyth_string_list_append_int (slist, prog->startts->tv_sec);  /* 11 */ //DATETIME_TO_LIST(startts)
    2.17 +        gmyth_string_list_append_int64 (slist, prog->startts->tv_sec);  /* 10 */ //DATETIME_TO_LIST(startts)
    2.18      else
    2.19 -	gmyth_string_list_append_int (slist, 0);
    2.20 +	gmyth_string_list_append_int64 (slist, 0);
    2.21      
    2.22      if (prog->endts)
    2.23 -        gmyth_string_list_append_int (slist, prog->endts->tv_sec);  /* 12 */ //DATETIME_TO_LIST(endts)
    2.24 +        gmyth_string_list_append_int64 (slist, prog->endts->tv_sec);  /* 12 */ //DATETIME_TO_LIST(endts)
    2.25      else
    2.26 -	gmyth_string_list_append_int (slist, 0);
    2.27 +	gmyth_string_list_append_int64 (slist, 0);
    2.28  
    2.29 -    gmyth_string_list_append_int (slist, prog->duplicate); /* 13 */
    2.30 -    gmyth_string_list_append_int (slist, prog->shareable); /* 14 */
    2.31 -    gmyth_string_list_append_int (slist, prog->findid); /* 15 */
    2.32 +    gmyth_string_list_append_int (slist, prog->duplicate); /* 14 */
    2.33 +    gmyth_string_list_append_int (slist, prog->shareable); /* 15 */
    2.34 +    gmyth_string_list_append_int (slist, prog->findid); /* 16 */
    2.35      gmyth_string_list_append_string (slist, prog->hostname); /* 16 */
    2.36      gmyth_string_list_append_int (slist, prog->sourceid); /* 17 */
    2.37      gmyth_string_list_append_int (slist, prog->cardid); /* 18 */
    2.38 @@ -338,8 +338,8 @@
    2.39      gmyth_string_list_append_int (slist, 0 /*prog->rectype*/); /* 23 */
    2.40      gmyth_string_list_append_int (slist, 0 /*prog->dupin*/); /* 24 */
    2.41      gmyth_string_list_append_int (slist, 0 /*prog->dupmethod*/); /* 25 */
    2.42 -    gmyth_string_list_append_int (slist, prog->recstartts != NULL ? prog->recstartts->tv_sec : 0);  /* 26 */ //DATETIME_TO_LIST(recstartts)
    2.43 -    gmyth_string_list_append_int (slist, prog->recendts != NULL ? prog->recendts->tv_sec : 0);  /* 27 */ //DATETIME_TO_LIST(recendts)
    2.44 +    gmyth_string_list_append_int64 (slist, prog->recstartts != NULL ? prog->recstartts->tv_sec : 0);  /* 26 */ //DATETIME_TO_LIST(recstartts)
    2.45 +    gmyth_string_list_append_int64 (slist, prog->recendts != NULL ? prog->recendts->tv_sec : 0);  /* 27 */ //DATETIME_TO_LIST(recendts)
    2.46      gmyth_string_list_append_int (slist, prog->repeat); /* 28 */
    2.47      gmyth_string_list_append_int (slist, prog->programflags); /* 29 */
    2.48      gmyth_string_list_append_char_array (slist, "Default"); /* 30 */ //prog->(recgroup != "") ? recgroup : "Default")
    2.49 @@ -348,9 +348,9 @@
    2.50      gmyth_string_list_append_string (slist, prog->seriesid); /* 33 */
    2.51      gmyth_string_list_append_string (slist, prog->programid); /* 34 */
    2.52      gmyth_string_list_append_char_array (slist, ""); /* 35 */
    2.53 -    gmyth_string_list_append_int (slist, prog->lastmodified != NULL ? prog->lastmodified->tv_sec : 0);  /* 36 */ //DATETIME_TO_LIST(lastmodified)
    2.54 +    gmyth_string_list_append_int64 (slist, prog->lastmodified != NULL ? prog->lastmodified->tv_sec : 0);  /* 36 */ //DATETIME_TO_LIST(lastmodified)
    2.55      gmyth_string_list_append_int (slist, 0);  /* 37 */ //FLOAT_TO_LIST(stars)
    2.56 -    gmyth_string_list_append_int (slist, prog->originalAirDate != NULL ? prog->originalAirDate->tv_sec : 0);  /* 38 */ //DATETIME_TO_LIST(QDateTime(originalAirDate))
    2.57 +    gmyth_string_list_append_int64 (slist, prog->originalAirDate != NULL ? prog->originalAirDate->tv_sec : 0);  /* 38 */ //DATETIME_TO_LIST(QDateTime(originalAirDate))
    2.58      gmyth_string_list_append_int (slist, prog->hasAirDate); /* 39 */
    2.59      gmyth_string_list_append_char_array (slist, "Default");  /* 40 */ //prog->(playgroup != "") ? playgroup : "Default")
    2.60      gmyth_string_list_append_int (slist, prog->recpriority2); /* 41 */
    2.61 @@ -422,7 +422,7 @@
    2.62      prog->filesize = gmyth_string_list_get_int64 (slist, 9);
    2.63  
    2.64      prog->startts = gmyth_util_string_to_time_val( (gmyth_util_time_to_isoformat( 
    2.65 -    					(time_t)gmyth_string_list_get_int64 (slist, 11) ))->str ); //DATETIME_TO_LIST(startts)
    2.66 +    					(time_t)gmyth_string_list_get_int (slist, 11) ))->str ); //DATETIME_TO_LIST(startts)
    2.67      prog->endts = gmyth_util_string_to_time_val( (gmyth_util_time_to_isoformat( 
    2.68      					(time_t)gmyth_string_list_get_int (slist, 12) ))->str ); //DATETIME_TO_LIST(endts)
    2.69      prog->duplicate = gmyth_string_list_get_int (slist, 13);
    2.70 @@ -457,7 +457,7 @@
    2.71      					(time_t)gmyth_string_list_get_int (slist, 38) ))->str ); //DATETIME_TO_LIST(QDateTime(originalAirDate))
    2.72      prog->hasAirDate = gmyth_string_list_get_int (slist, 39);
    2.73      prog->playgroup = gmyth_string_list_get_string (slist, 40); //prog->(playgroup != "") ? playgroup : "Default")
    2.74 -    prog->recpriority2 = gmyth_string_list_get_int (slist, 41);
    2.75 +    //prog->recpriority2 = gmyth_string_list_get_int (slist, 41);
    2.76     
    2.77      return prog;
    2.78  }
     3.1 --- a/gmyth/src/gmyth_tvchain.c	Fri Feb 02 22:46:13 2007 +0000
     3.2 +++ b/gmyth/src/gmyth_tvchain.c	Tue Feb 06 00:33:35 2007 +0000
     3.3 @@ -194,7 +194,7 @@
     3.4  		tvchain->tvchain_list = NULL;
     3.5  	}
     3.6  
     3.7 -	// TODO: Reuse gmyth_query already connected from context
     3.8 +	/* TODO: Reuse gmyth_query already connected from context */
     3.9  	gmyth_query = gmyth_query_new ();
    3.10  	if (!gmyth_query_connect (gmyth_query, tvchain->backend_info)) {
    3.11  		g_warning ("[%s] Could not connect to db", __FUNCTION__);