# HG changeset patch # User rosfran # Date 1175626132 -3600 # Node ID 1f143a0376aa570c50af3d2bfe67cc59be19b42e # Parent f12aac49c2a5ca5339fe06e7590c3ef7f9844df5 [svn r494] Added function to get the channel list from the MythTV backend. diff -r f12aac49c2a5 -r 1f143a0376aa gmyth/src/gmyth_util.c --- a/gmyth/src/gmyth_util.c Tue Apr 03 19:42:53 2007 +0100 +++ b/gmyth/src/gmyth_util.c Tue Apr 03 19:48:52 2007 +0100 @@ -565,15 +565,14 @@ res = gmyth_recorder_setup (recorder); if (res == TRUE) { - channel_list = gmyth_recorder_get_channel_list( recorder ); + //GList* channel_list = gmyth_recorder_get_channel_list( recorder ); gmyth_debug( "Yeah, got channel list!!!" ); - /* GList* ch = NULL; GMythChannelInfo* channel_info = NULL; for ( ch = gmyth_recorder_get_channel_list( recorder ); ch != NULL; ) { - channel_info = g_malloc0(GMythChannelInfo, sizeof(GMythChannelInfo)); + channel_info = g_malloc0( sizeof(GMythChannelInfo) ); channel_info->channel_ID = 0; channel_info->channel_num = g_string_new ( g_strdup( (gchar*)ch->data ) ); channel_info->channel_name = g_string_new (""); @@ -585,15 +584,14 @@ if ( channel_info != NULL ) g_free( channel_info ); } - - */ - } /* if */ else { gmyth_debug( "No, couldn't get the channel list!!!" ); } + gmyth_debug( "Got %d channels!!!", g_list_length( channel_list ) ); + g_object_unref (recorder); return channel_list;