# HG changeset patch # User rosfran # Date 1175625563 -3600 # Node ID 56b98fd15019ff5742d8bbbf8eb1cd4e522d3d53 # Parent 00a5cf92ec21476717859bfeffd82232d0932556 [svn r491] Solve bug with the --enable-debug on configure.ac; reversed changes in the GMythBackendInfo object; procedure to close the Recorder in not mandatory. diff -r 00a5cf92ec21 -r 56b98fd15019 gmyth/configure.ac --- a/gmyth/configure.ac Tue Apr 03 16:43:11 2007 +0100 +++ b/gmyth/configure.ac Tue Apr 03 19:39:23 2007 +0100 @@ -78,17 +78,20 @@ # Checks required packages -dnl Test if --disable-debug given +dnl Test if --enable-debug given AC_ARG_ENABLE(debug, - [AC_HELP_STRING([--disable-debug], [disable debugging mode])], - enable_debug=no, - enable_debug=yes) + [AC_HELP_STRING([--enable-debug], [disable debugging mode])], + enable_debug=yes, + enable_debug=no) -if test "x$enable_debug" = "xyes"; then +if test "x$enable_debug" = "xyes" ; then + AC_DEFINE(GMYTH_USE_DEBUG, 1, [Debug enabled!]) CFLAGS="$CFLAGS -g -DGMYTH_USE_DEBUG" else CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS" -fi +fi + +AM_CONDITIONAL(GMYTH_USE_DEBUG, test "x$enable_debug" = "xyes") # Check for pkgconfig AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no) diff -r 00a5cf92ec21 -r 56b98fd15019 gmyth/src/gmyth_backendinfo.c --- a/gmyth/src/gmyth_backendinfo.c Tue Apr 03 16:43:11 2007 +0100 +++ b/gmyth/src/gmyth_backendinfo.c Tue Apr 03 19:39:23 2007 +0100 @@ -208,7 +208,7 @@ } void -gmyth_backend_info_set_port (GMythBackendInfo *backend_info, const gint port ) +gmyth_backend_info_set_port (GMythBackendInfo *backend_info, gint port ) { g_return_if_fail (backend_info != NULL); @@ -220,7 +220,7 @@ } void -gmyth_backend_info_set_status_port (GMythBackendInfo *backend_info, const gint port ) +gmyth_backend_info_set_status_port (GMythBackendInfo *backend_info, gint port ) { g_return_if_fail (backend_info != NULL); diff -r 00a5cf92ec21 -r 56b98fd15019 gmyth/src/gmyth_backendinfo.h --- a/gmyth/src/gmyth_backendinfo.h Tue Apr 03 16:43:11 2007 +0100 +++ b/gmyth/src/gmyth_backendinfo.h Tue Apr 03 19:39:23 2007 +0100 @@ -97,6 +97,7 @@ gint port); void gmyth_backend_info_set_status_port (GMythBackendInfo *backend_info, gint port); + const gchar* gmyth_backend_info_get_hostname (GMythBackendInfo *backend_info); const gchar* gmyth_backend_info_get_username (GMythBackendInfo *backend_info); const gchar* gmyth_backend_info_get_password (GMythBackendInfo *backend_info); diff -r 00a5cf92ec21 -r 56b98fd15019 gmyth/src/gmyth_livetv.c --- a/gmyth/src/gmyth_livetv.c Tue Apr 03 16:43:11 2007 +0100 +++ b/gmyth/src/gmyth_livetv.c Tue Apr 03 19:39:23 2007 +0100 @@ -103,6 +103,7 @@ } if ( livetv->recorder != NULL ) { + gmyth_recorder_close(livetv->recorder); g_object_unref (livetv->recorder); livetv->recorder = NULL; } @@ -423,7 +424,7 @@ res = FALSE; goto error; } - + /* Creates livetv chain handler */ livetv->tvchain = gmyth_tvchain_new(); gmyth_tvchain_initialize ( livetv->tvchain, livetv->backend_info ); diff -r 00a5cf92ec21 -r 56b98fd15019 gmyth/src/gmyth_recorder.c --- a/gmyth/src/gmyth_recorder.c Tue Apr 03 16:43:11 2007 +0100 +++ b/gmyth/src/gmyth_recorder.c Tue Apr 03 19:39:23 2007 +0100 @@ -72,7 +72,7 @@ { GMythRecorder *recorder= GMYTH_RECORDER(object); - gmyth_recorder_close(recorder); + /* gmyth_recorder_close(recorder); */ if ( recorder->mutex != NULL) { g_mutex_free(recorder->mutex); @@ -83,10 +83,12 @@ g_object_unref(recorder->myth_socket); recorder->myth_socket = NULL; } - - gmyth_free_program_list (recorder->progs_info_list); - - g_string_free (recorder->hostname, TRUE); + + if ( recorder->progs_info_list != NULL ) + gmyth_free_program_list (recorder->progs_info_list); + + if ( recorder->hostname != NULL ) + g_string_free (recorder->hostname, TRUE); G_OBJECT_CLASS (gmyth_recorder_parent_class)->dispose (object); } @@ -611,10 +613,10 @@ channel_list = g_list_append( channel_list, g_strdup( channel ) ); } - g_free( channel ); - } /* for - channel list */ + g_free( channel ); + return channel_list; } diff -r 00a5cf92ec21 -r 56b98fd15019 gmyth/src/gmyth_util.c --- a/gmyth/src/gmyth_util.c Tue Apr 03 16:43:11 2007 +0100 +++ b/gmyth/src/gmyth_util.c Tue Apr 03 19:39:23 2007 +0100 @@ -560,29 +560,39 @@ g_return_val_if_fail (backend_info != NULL, FALSE); - recorder = gmyth_recorder_new ( 0, g_string_new( gmyth_backend_info_get_hostname( backend_info ) ), + recorder = gmyth_recorder_new ( 1, g_string_new( gmyth_backend_info_get_hostname( backend_info ) ), gmyth_backend_info_get_port( backend_info ) ); res = gmyth_recorder_setup (recorder); if (res == TRUE) { - GList* channel_list_strs = gmyth_recorder_get_channel_list( recorder ); + channel_list = gmyth_recorder_get_channel_list( recorder ); + gmyth_debug( "Yeah, got channel list!!!" ); + /* GList* ch = NULL; GMythChannelInfo* channel_info = NULL; - for ( ch = channel_list_strs; ch != NULL; ch = g_list_next(ch) ) + for ( ch = gmyth_recorder_get_channel_list( recorder ); ch != NULL; ) { - channel_info = g_new0(GMythChannelInfo, 1); + channel_info = g_malloc0(GMythChannelInfo, 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 (""); gmyth_debug("Printing channel info... (%s)", channel_info->channel_num->str ); - channel_list = g_list_append( channel_list, channel_info ); - } /* for */ + channel_list = g_list_append( channel_list, g_memdup( channel_info, sizeof(GMythChannelInfo) ) ); + + ch = g_list_next(ch); + + if ( channel_info != NULL ) + g_free( channel_info ); + } - //if ( channel_info != NULL ) - // g_free( channel_info ); + */ + } /* if */ + else { + gmyth_debug( "No, couldn't get the channel list!!!" ); + } g_object_unref (recorder);