# HG changeset patch # User rosfran # Date 1170722015 0 # Node ID 81b1f3006eb22da8c551680647a85273eba5e262 # Parent b6b5f2dc831d36b2711ca85a594ec5b7bc665533 [svn r328] Some fixes on program info, and some memory clean ups. diff -r b6b5f2dc831d -r 81b1f3006eb2 gmyth/src/gmyth_livetv.c --- a/gmyth/src/gmyth_livetv.c Fri Feb 02 22:46:13 2007 +0000 +++ b/gmyth/src/gmyth_livetv.c Tue Feb 06 00:33:35 2007 +0000 @@ -259,8 +259,7 @@ livetv->monitor = NULL; } -} - +} /* static gchar* @@ -276,7 +275,8 @@ */ static gboolean -gmyth_livetv_setup_recorder_channel_name ( GMythLiveTV *livetv, gchar* channel, GMythBackendInfo *backend_info ) +gmyth_livetv_setup_recorder_channel_name ( GMythLiveTV *livetv, gchar* channel, + GMythBackendInfo *backend_info ) { gboolean res = TRUE; @@ -286,7 +286,7 @@ g_static_mutex_lock( &lock ); - // FIME: Implement this at gmyth_socket + /* FIME: Implement this at gmyth_socket */ res = gmyth_socket_connect_to_backend (socket, livetv->backend_info->hostname, livetv->backend_info->port, TRUE); if (!res) { @@ -320,7 +320,7 @@ goto error; } - // Init remote encoder. Opens its control socket. + /* Init remote encoder. Opens its control socket. */ res = gmyth_recorder_setup(livetv->recorder); if ( !res ) { g_warning ("[%s] Fail while setting remote encoder\n", __FUNCTION__); @@ -328,7 +328,7 @@ goto error; } - // Creates livetv chain handler + /* Creates livetv chain handler */ livetv->tvchain = GMYTH_TVCHAIN ( g_object_new(GMYTH_TVCHAIN_TYPE, NULL) ); gmyth_tvchain_initialize ( livetv->tvchain, livetv->backend_info ); @@ -371,11 +371,11 @@ { if ( gmyth_recorder_set_channel_name( livetv->recorder, channel ) ) { - g_print( "[%s] Channel changed!!! [%s].\n", __FUNCTION__, channel ); + gmyth_debug( "Channel changed!!! [%s].\n", channel ); } } - } + } /* if - changes the channel number */ sleep (9); /* FIXME: this is evil (tpm) */ } @@ -390,7 +390,7 @@ gint i; gchar *channame = NULL; - fprintf(stderr, "problem getting current proginfo!\n"); + gmyth_debug( "Problem getting current proginfo!\n" ); /* * mythbackend must not be tuned in to a channel, so keep @@ -408,8 +408,9 @@ if (prog_info != NULL) break; } - - } + + } /* if - Program Info */ + /* prints program info data text */ gmyth_debug( "New ProgramInfo...\n" ); gmyth_program_info_print( prog_info ); @@ -417,10 +418,12 @@ gmyth_debug( "Old ProgramInfo...\n" ); gmyth_program_info_print( livetv->proginfo ); + /* GMythProgramInfo* prog_inf = gmyth_recorder_get_next_program_info( livetv->recorder, BROWSE_DIRECTION_UP ); gmyth_debug( "Next ProgramInfo...\n" ); gmyth_program_info_print( prog_inf ); + */ /* check if the program chain could be obtained from the MythTV protocol message */ if ( prog_info != NULL ) diff -r b6b5f2dc831d -r 81b1f3006eb2 gmyth/src/gmyth_programinfo.c --- a/gmyth/src/gmyth_programinfo.c Fri Feb 02 22:46:13 2007 +0000 +++ b/gmyth/src/gmyth_programinfo.c Tue Feb 06 00:33:35 2007 +0000 @@ -309,25 +309,25 @@ gmyth_string_list_append_string (slist, prog->chansign); /* 6 */ gmyth_string_list_append_string (slist, prog->channame); /* 7 */ gmyth_string_list_append_string (slist, prog->pathname); /* 8 */ - gmyth_string_list_append_int (slist, 0); /* 11 */ + gmyth_string_list_append_int (slist, 0); /* 9 */ // fixme //gmyth_string_list_append_int64 (slist, 100/*prog->filesize*/); /* 9 */ - gmyth_string_list_append_int64 (slist, 0); /* 11 */ + //gmyth_string_list_append_int (slist, 0); /* 10 */ if (prog->startts) - gmyth_string_list_append_int (slist, prog->startts->tv_sec); /* 11 */ //DATETIME_TO_LIST(startts) + gmyth_string_list_append_int64 (slist, prog->startts->tv_sec); /* 10 */ //DATETIME_TO_LIST(startts) else - gmyth_string_list_append_int (slist, 0); + gmyth_string_list_append_int64 (slist, 0); if (prog->endts) - gmyth_string_list_append_int (slist, prog->endts->tv_sec); /* 12 */ //DATETIME_TO_LIST(endts) + gmyth_string_list_append_int64 (slist, prog->endts->tv_sec); /* 12 */ //DATETIME_TO_LIST(endts) else - gmyth_string_list_append_int (slist, 0); + gmyth_string_list_append_int64 (slist, 0); - gmyth_string_list_append_int (slist, prog->duplicate); /* 13 */ - gmyth_string_list_append_int (slist, prog->shareable); /* 14 */ - gmyth_string_list_append_int (slist, prog->findid); /* 15 */ + gmyth_string_list_append_int (slist, prog->duplicate); /* 14 */ + gmyth_string_list_append_int (slist, prog->shareable); /* 15 */ + gmyth_string_list_append_int (slist, prog->findid); /* 16 */ gmyth_string_list_append_string (slist, prog->hostname); /* 16 */ gmyth_string_list_append_int (slist, prog->sourceid); /* 17 */ gmyth_string_list_append_int (slist, prog->cardid); /* 18 */ @@ -338,8 +338,8 @@ gmyth_string_list_append_int (slist, 0 /*prog->rectype*/); /* 23 */ gmyth_string_list_append_int (slist, 0 /*prog->dupin*/); /* 24 */ gmyth_string_list_append_int (slist, 0 /*prog->dupmethod*/); /* 25 */ - gmyth_string_list_append_int (slist, prog->recstartts != NULL ? prog->recstartts->tv_sec : 0); /* 26 */ //DATETIME_TO_LIST(recstartts) - gmyth_string_list_append_int (slist, prog->recendts != NULL ? prog->recendts->tv_sec : 0); /* 27 */ //DATETIME_TO_LIST(recendts) + gmyth_string_list_append_int64 (slist, prog->recstartts != NULL ? prog->recstartts->tv_sec : 0); /* 26 */ //DATETIME_TO_LIST(recstartts) + gmyth_string_list_append_int64 (slist, prog->recendts != NULL ? prog->recendts->tv_sec : 0); /* 27 */ //DATETIME_TO_LIST(recendts) gmyth_string_list_append_int (slist, prog->repeat); /* 28 */ gmyth_string_list_append_int (slist, prog->programflags); /* 29 */ gmyth_string_list_append_char_array (slist, "Default"); /* 30 */ //prog->(recgroup != "") ? recgroup : "Default") @@ -348,9 +348,9 @@ gmyth_string_list_append_string (slist, prog->seriesid); /* 33 */ gmyth_string_list_append_string (slist, prog->programid); /* 34 */ gmyth_string_list_append_char_array (slist, ""); /* 35 */ - gmyth_string_list_append_int (slist, prog->lastmodified != NULL ? prog->lastmodified->tv_sec : 0); /* 36 */ //DATETIME_TO_LIST(lastmodified) + gmyth_string_list_append_int64 (slist, prog->lastmodified != NULL ? prog->lastmodified->tv_sec : 0); /* 36 */ //DATETIME_TO_LIST(lastmodified) gmyth_string_list_append_int (slist, 0); /* 37 */ //FLOAT_TO_LIST(stars) - gmyth_string_list_append_int (slist, prog->originalAirDate != NULL ? prog->originalAirDate->tv_sec : 0); /* 38 */ //DATETIME_TO_LIST(QDateTime(originalAirDate)) + gmyth_string_list_append_int64 (slist, prog->originalAirDate != NULL ? prog->originalAirDate->tv_sec : 0); /* 38 */ //DATETIME_TO_LIST(QDateTime(originalAirDate)) gmyth_string_list_append_int (slist, prog->hasAirDate); /* 39 */ gmyth_string_list_append_char_array (slist, "Default"); /* 40 */ //prog->(playgroup != "") ? playgroup : "Default") gmyth_string_list_append_int (slist, prog->recpriority2); /* 41 */ @@ -422,7 +422,7 @@ prog->filesize = gmyth_string_list_get_int64 (slist, 9); prog->startts = gmyth_util_string_to_time_val( (gmyth_util_time_to_isoformat( - (time_t)gmyth_string_list_get_int64 (slist, 11) ))->str ); //DATETIME_TO_LIST(startts) + (time_t)gmyth_string_list_get_int (slist, 11) ))->str ); //DATETIME_TO_LIST(startts) prog->endts = gmyth_util_string_to_time_val( (gmyth_util_time_to_isoformat( (time_t)gmyth_string_list_get_int (slist, 12) ))->str ); //DATETIME_TO_LIST(endts) prog->duplicate = gmyth_string_list_get_int (slist, 13); @@ -457,7 +457,7 @@ (time_t)gmyth_string_list_get_int (slist, 38) ))->str ); //DATETIME_TO_LIST(QDateTime(originalAirDate)) prog->hasAirDate = gmyth_string_list_get_int (slist, 39); prog->playgroup = gmyth_string_list_get_string (slist, 40); //prog->(playgroup != "") ? playgroup : "Default") - prog->recpriority2 = gmyth_string_list_get_int (slist, 41); + //prog->recpriority2 = gmyth_string_list_get_int (slist, 41); return prog; } diff -r b6b5f2dc831d -r 81b1f3006eb2 gmyth/src/gmyth_tvchain.c --- a/gmyth/src/gmyth_tvchain.c Fri Feb 02 22:46:13 2007 +0000 +++ b/gmyth/src/gmyth_tvchain.c Tue Feb 06 00:33:35 2007 +0000 @@ -194,7 +194,7 @@ tvchain->tvchain_list = NULL; } - // TODO: Reuse gmyth_query already connected from context + /* TODO: Reuse gmyth_query already connected from context */ gmyth_query = gmyth_query_new (); if (!gmyth_query_connect (gmyth_query, tvchain->backend_info)) { g_warning ("[%s] Could not connect to db", __FUNCTION__);