[svn r469] bug fix trunk
authorrenatofilho
Tue Mar 27 21:42:35 2007 +0100 (2007-03-27)
branchtrunk
changeset 4645ef4452c42cc
parent 463 771f91aa9d5d
child 465 997f281ba596
[svn r469] bug fix
gmyth/src/gmyth_jobqueue.c
gmyth/src/gmyth_livetv.c
gmyth/src/gmyth_monitor_handler.c
gmyth/src/gmyth_query.c
gmyth/src/gmyth_socket.c
gmyth/src/gmyth_transcoder.c
     1.1 --- a/gmyth/src/gmyth_jobqueue.c	Tue Mar 27 21:31:34 2007 +0100
     1.2 +++ b/gmyth/src/gmyth_jobqueue.c	Tue Mar 27 21:42:35 2007 +0100
     1.3 @@ -46,10 +46,10 @@
     1.4      if (gmyth_socket_connect_to_backend (socket,
     1.5              gmyth_backend_info_get_hostname (backend_info),
     1.6              gmyth_backend_info_get_port (backend_info), TRUE) == TRUE) {
     1.7 -        g_debug ("Backend socket connection success");
     1.8 +        gmyth_debug ("Backend socket connection success");
     1.9          return socket;
    1.10      } else {
    1.11 -        g_debug ("Connection failed");
    1.12 +        gmyth_debug ("Connection failed");
    1.13          return NULL;
    1.14      }
    1.15  }
    1.16 @@ -109,7 +109,7 @@
    1.17      if (g_ascii_strcasecmp(ret, value) == 0) {
    1.18          return TRUE;
    1.19      } else {
    1.20 -        g_debug("JobQueue Error: %s", ret);
    1.21 +        gmyth_debug("JobQueue Error: %s", ret);
    1.22          return FALSE;
    1.23      }
    1.24  }
    1.25 @@ -155,7 +155,7 @@
    1.26              g_free (ret);
    1.27  
    1.28      } else {
    1.29 -        g_debug("JobQueue Connection Failed");
    1.30 +        gmyth_debug("JobQueue Connection Failed");
    1.31      }
    1.32  
    1.33      return res;
    1.34 @@ -188,7 +188,7 @@
    1.35          g_free(ret);
    1.36  
    1.37      } else {
    1.38 -        g_debug("JobQueue Connection Failed");
    1.39 +        gmyth_debug("JobQueue Connection Failed");
    1.40      }
    1.41  
    1.42      return res;
     2.1 --- a/gmyth/src/gmyth_livetv.c	Tue Mar 27 21:31:34 2007 +0100
     2.2 +++ b/gmyth/src/gmyth_livetv.c	Tue Mar 27 21:42:35 2007 +0100
     2.3 @@ -470,7 +470,7 @@
     2.4  	
     2.5  		} /* if - changes the channel number */
     2.6  		
     2.7 -    sleep (6);                  /* FIXME: this is evil (tpm) */
     2.8 +    //sleep (1);                  /* FIXME: this is evil (tpm) */
     2.9    }
    2.10    
    2.11    /* DEBUG message */  
     3.1 --- a/gmyth/src/gmyth_monitor_handler.c	Tue Mar 27 21:31:34 2007 +0100
     3.2 +++ b/gmyth/src/gmyth_monitor_handler.c	Tue Mar 27 21:42:35 2007 +0100
     3.3 @@ -145,63 +145,49 @@
     3.4  gmyth_monitor_handler_dispose  (GObject *object)
     3.5  {
     3.6  	GMythMonitorHandler *monitor = GMYTH_MONITOR_HANDLER (object);
     3.7 -	GSource* source = NULL;
     3.8 -	//GMainContext* context = g_main_context_default();
     3.9 -  
    3.10 -  gmyth_monitor_handler_close(monitor);
    3.11 +    gmyth_monitor_handler_close(monitor);
    3.12  
    3.13  	monitor->allow_msgs_listener = FALSE;
    3.14  
    3.15 -	if ( monitor->sid_io_watch != -1 )
    3.16 +	if (monitor->sid_io_watch != -1)
    3.17  	{
    3.18 -		//g_main_context_acquire( context );
    3.19 -		
    3.20 -		source = g_main_context_find_source_by_id( NULL, 
    3.21 -						monitor->sid_io_watch );
    3.22 -		
    3.23 -		if ( source != NULL )
    3.24 -		{
    3.25 -			g_source_destroy( source );
    3.26 -		}
    3.27 -		
    3.28 -		//g_main_context_release( context );
    3.29 -		
    3.30 +        g_source_remove (monitor->sid_io_watch);
    3.31  	}
    3.32  
    3.33 -  /* mutex to control access to the event socket consumer thread */
    3.34 -  if ( monitor->mutex != NULL )
    3.35 -  {
    3.36 -  	g_mutex_free( monitor->mutex );
    3.37 -  	monitor->mutex = NULL;
    3.38 -  }
    3.39 +    /* mutex to control access to the event socket consumer thread */
    3.40 +    if ( monitor->mutex != NULL )
    3.41 +    {
    3.42 +    	g_mutex_free( monitor->mutex );
    3.43 +  	    monitor->mutex = NULL;
    3.44 +    }
    3.45  	
    3.46 -  if ( monitor->event_sock != NULL )  
    3.47 -  {
    3.48 -  	g_object_unref( monitor->event_sock );
    3.49 -  	monitor->event_sock = NULL;
    3.50 -  }
    3.51 +    if ( monitor->event_sock != NULL )  
    3.52 +    {
    3.53 +  	    g_object_unref( monitor->event_sock );
    3.54 +  	    monitor->event_sock = NULL;
    3.55 +    }
    3.56  
    3.57 -  if ( monitor->hostname != NULL )  
    3.58 -  {
    3.59 -  	g_free( monitor->hostname );
    3.60 -  	monitor->hostname = NULL;
    3.61 -  }
    3.62 +    if ( monitor->hostname != NULL )  
    3.63 +    {
    3.64 +  	    g_free( monitor->hostname );
    3.65 +  	    monitor->hostname = NULL;
    3.66 +    }
    3.67  
    3.68 -  if ( monitor->backend_msgs != NULL )
    3.69 -  {
    3.70 -  	g_hash_table_destroy ( monitor->backend_msgs );
    3.71 -  	monitor->backend_msgs = NULL;
    3.72 -  }
    3.73 +    if ( monitor->backend_msgs != NULL )
    3.74 +    {
    3.75 +  	    g_hash_table_destroy ( monitor->backend_msgs );
    3.76 +  	    monitor->backend_msgs = NULL;
    3.77 +    }
    3.78   
    3.79 -  /*
    3.80 -  if ( io_watcher_cond != NULL )  
    3.81 -  {
    3.82 -  	g_cond_free( io_watcher_cond );
    3.83 -  	io_watcher_cond = NULL;
    3.84 -  }
    3.85 -  */
    3.86 +    /*
    3.87 +    if ( io_watcher_cond != NULL )  
    3.88 +    {
    3.89 +        g_cond_free( io_watcher_cond );
    3.90 +        io_watcher_cond = NULL;
    3.91 +    }
    3.92 +    */
    3.93    
    3.94 -  G_OBJECT_CLASS (gmyth_monitor_handler_parent_class)->dispose (object);
    3.95 +    G_OBJECT_CLASS (gmyth_monitor_handler_parent_class)->dispose (object);
    3.96  }
    3.97  
    3.98  static void
    3.99 @@ -238,11 +224,11 @@
   3.100  myth_control_acquire_context( GMythMonitorHandler *monitor, gboolean do_wait ) 
   3.101  {
   3.102  	
   3.103 -	gboolean ret = TRUE;	
   3.104 +    gboolean ret = TRUE;	
   3.105    	
   3.106 -  g_mutex_lock( monitor->mutex );
   3.107 +    g_mutex_lock( monitor->mutex );
   3.108    
   3.109 -  return ret;
   3.110 +    return ret;
   3.111    
   3.112  }
   3.113  
   3.114 @@ -259,10 +245,9 @@
   3.115  	
   3.116  	gboolean ret = TRUE;
   3.117      
   3.118 -  g_mutex_unlock( monitor->mutex );
   3.119 +    g_mutex_unlock( monitor->mutex );
   3.120    
   3.121 -  return ret;
   3.122 -  
   3.123 +    return ret;
   3.124  }
   3.125  
   3.126  void
   3.127 @@ -310,13 +295,13 @@
   3.128      monitor->hostname = NULL;
   3.129    }
   3.130  
   3.131 -  monitor->hostname = g_strdup( hostname );
   3.132 +  monitor->hostname = g_strdup (hostname);
   3.133    monitor->port = port;
   3.134  
   3.135    gmyth_debug ("Monitor event socket --- hostname: %s, port %d\n", monitor->hostname, monitor->port);
   3.136    
   3.137    /* configure the event socket */
   3.138 -  if ( NULL == monitor->event_sock ) { 
   3.139 +  if ( NULL == monitor->event_sock) { 
   3.140        if (!gmyth_connect_to_backend_monitor (monitor)) {
   3.141            gmyth_debug( "Connection to backend failed (Event Socket)." );
   3.142            ret = FALSE;
   3.143 @@ -355,7 +340,7 @@
   3.144  		                                strstr( back_msg->str, "BACKEND" ) != NULL )
   3.145  		{
   3.146  			gmyth_debug( "MONITOR HANDLER - Received backend message = %s", back_msg->str );
   3.147 -	  	*back_msg_action = gmyth_string_list_get_char_array( strlist, 1 );
   3.148 +	  	    *back_msg_action = gmyth_string_list_get_char_array( strlist, 1 );
   3.149  	  	
   3.150  	  	if ( back_msg_action != NULL )
   3.151  	  	{	        	
   3.152 @@ -501,7 +486,7 @@
   3.153  	    	strlist = NULL;
   3.154  	    }
   3.155  
   3.156 -      io_cond = g_io_channel_get_buffer_condition( io_channel );
   3.157 +      io_cond = g_io_channel_get_buffer_condition (io_channel);
   3.158  
   3.159      } while ( recv <= 0 && ( ( io_cond & G_IO_HUP ) == 0 ) );
   3.160      
   3.161 @@ -564,7 +549,7 @@
   3.162      
   3.163      monitor->sid_io_watch = -1;
   3.164    	
   3.165 -    monitor->sid_io_watch = g_io_add_watch( channel, G_IO_IN | G_IO_HUP, 
   3.166 +    monitor->sid_io_watch = g_io_add_watch (channel, G_IO_IN | G_IO_HUP, 
   3.167      					(GIOFunc)gmyth_monitor_handler_listener, monitor );
   3.168    } else {
   3.169    	ret = FALSE;
   3.170 @@ -593,20 +578,20 @@
   3.171  gboolean 
   3.172  gmyth_monitor_handler_start (GMythMonitorHandler *monitor)
   3.173  {
   3.174 -	gboolean ret = TRUE;
   3.175 +    gboolean ret = TRUE;
   3.176  	
   3.177 -  ret = gmyth_monitor_handler_setup( monitor, monitor->event_sock->sd_io_ch ); 
   3.178 -  if ( ret ) {
   3.179 -  	gmyth_debug ( "\n[%s]\tOK! Starting listener on the MONITOR event socket...[thread location = %p]\n", 
   3.180 +    ret = gmyth_monitor_handler_setup( monitor, monitor->event_sock->sd_io_ch ); 
   3.181 +    if ( ret ) {
   3.182 +  	    gmyth_debug ( "\n[%s]\tOK! Starting listener on the MONITOR event socket...[thread location = %p]\n", 
   3.183    				__FUNCTION__, g_thread_self( ) );
   3.184 -  	ret = TRUE;  	  	
   3.185 -  } else {
   3.186 -  	gmyth_debug ( "\n[%s]\tERROR! Coudn't start listener on the MONITOR event socket...[thread location = %p]\n", 
   3.187 +  	    ret = TRUE;  	  	
   3.188 +    } else {
   3.189 +  	    gmyth_debug ( "\n[%s]\tERROR! Coudn't start listener on the MONITOR event socket...[thread location = %p]\n", 
   3.190    				__FUNCTION__, g_thread_self( ) );
   3.191 -  	ret = FALSE;
   3.192 -  }
   3.193 +  	    ret = FALSE;
   3.194 +    }
   3.195  
   3.196 -  gmyth_debug( "[%s] Watch listener function over the IO control channel? %s!!!\n", 
   3.197 +    gmyth_debug( "[%s] Watch listener function over the IO control channel? %s!!!\n", 
   3.198    			__FUNCTION__, ( ret == TRUE ? "YES" : "NO" ) );
   3.199      
   3.200      return ret;
     4.1 --- a/gmyth/src/gmyth_query.c	Tue Mar 27 21:31:34 2007 +0100
     4.2 +++ b/gmyth/src/gmyth_query.c	Tue Mar 27 21:42:35 2007 +0100
     4.3 @@ -154,7 +154,7 @@
     4.4  		return FALSE;
     4.5      }
     4.6  
     4.7 -    g_debug ("[%s] Connection to Mysql server succeeded! (host = %s, user = %s, "\
     4.8 +    gmyth_debug ("[%s] Connection to Mysql server succeeded! (host = %s, user = %s, "\
     4.9      			"password = %s, db name = %s)", __FUNCTION__, 
    4.10      			gmyth_query->backend_info->hostname, 
    4.11                  gmyth_query->backend_info->username,
    4.12 @@ -175,7 +175,7 @@
    4.13      assert(gmyth_query);
    4.14      
    4.15      /* TODO: Check how to return error */
    4.16 -    g_debug ("[%s] Closing gmyth_query->conn", __FUNCTION__);
    4.17 +    gmyth_debug ("[%s] Closing gmyth_query->conn", __FUNCTION__);
    4.18  
    4.19      mysql_close (gmyth_query->conn);
    4.20  
    4.21 @@ -185,14 +185,14 @@
    4.22  static void
    4.23  gmyth_query_print_error (MYSQL *conn, char *message)
    4.24  {
    4.25 -    g_debug ("%s", message);
    4.26 +    gmyth_debug ("%s", message);
    4.27      
    4.28      if (conn != NULL) {
    4.29  #if MYSQL_VERSION_ID >= 40101
    4.30 -        g_debug ("Error %u (%s): %s\n",
    4.31 +        gmyth_debug ("Error %u (%s): %s\n",
    4.32                  mysql_errno (conn), mysql_sqlstate(conn), mysql_error (conn));
    4.33  #else
    4.34 -        g_debug ("Error %u: %s\n",
    4.35 +        gmyth_debug ("Error %u: %s\n",
    4.36                 mysql_errno (conn), mysql_error (conn));
    4.37  #endif
    4.38      }
    4.39 @@ -215,7 +215,7 @@
    4.40      
    4.41      assert(gmyth_query);
    4.42      
    4.43 -    g_debug ("[%s] Running mysql query %s", __FUNCTION__, stmt_str);
    4.44 +    gmyth_debug ("[%s] Running mysql query %s", __FUNCTION__, stmt_str);
    4.45  
    4.46      if (gmyth_query == NULL)
    4.47      	return NULL;
    4.48 @@ -231,7 +231,7 @@
    4.49      if (res_set) {
    4.50          return res_set;
    4.51      } else if (mysql_field_count (gmyth_query->conn) == 0) {
    4.52 -        g_debug ("%lu rows affected\n",
    4.53 +        gmyth_debug ("%lu rows affected\n",
    4.54                  (unsigned long) mysql_affected_rows (gmyth_query->conn));
    4.55      } else {
    4.56          gmyth_query_print_error (gmyth_query->conn, "Could not retrieve result set");
     5.1 --- a/gmyth/src/gmyth_socket.c	Tue Mar 27 21:31:34 2007 +0100
     5.2 +++ b/gmyth/src/gmyth_socket.c	Tue Mar 27 21:42:35 2007 +0100
     5.3 @@ -130,7 +130,7 @@
     5.4      gmyth_debug ("Getting name resolution for: %s, %d\n", addr, port);
     5.5  
     5.6      if ( ( errorn = getaddrinfo(addr, portStr, &hints, addrInfo) ) != 0 ) {
     5.7 -		g_debug( "[%s] Socket ERROR: %s\n", __FUNCTION__, gai_strerror(errorn) );
     5.8 +		gmyth_debug( "[%s] Socket ERROR: %s\n", __FUNCTION__, gai_strerror(errorn) );
     5.9      }
    5.10  
    5.11      g_free (portStr);
    5.12 @@ -138,16 +138,18 @@
    5.13      return errorn;
    5.14  }
    5.15  
    5.16 +/*
    5.17  static gint
    5.18  gmyth_socket_find_match_address_uri( GMythURI* uri, gchar *address )
    5.19  {
    5.20      if ( g_ascii_strcasecmp( gmyth_uri_get_host( uri ), address ) == 0 ) {
    5.21 -        //g_debug( "Found URI: %s !!!\n", rui_uri_getvalue(uri) );
    5.22 +        //gmyth_debug( "Found URI: %s !!!\n", rui_uri_getvalue(uri) );
    5.23          return 0;
    5.24      } else {
    5.25          return -1;
    5.26      }
    5.27  }
    5.28 +*/
    5.29  
    5.30  static const gchar *PATH_PROC_NET_DEV = "/proc/net/dev";
    5.31  
    5.32 @@ -207,9 +209,11 @@
    5.33  }
    5.34  
    5.35  
    5.36 +
    5.37  /**
    5.38   * Get only the local addresses from the primary interface
    5.39   */
    5.40 +/*
    5.41  static gchar *
    5.42  gmyth_socket_get_primary_addr()
    5.43  {
    5.44 @@ -220,7 +224,7 @@
    5.45  	
    5.46  	if ( interfs != NULL && ( g_list_length( interfs ) > 0 ) ) 
    5.47  	{
    5.48 -		/* get the first occurrence (primary interface) */
    5.49 +		// get the first occurrence (primary interface) 
    5.50  		if_tmp = g_list_first( interfs );
    5.51  		
    5.52  		if ( if_tmp != NULL )
    5.53 @@ -233,6 +237,7 @@
    5.54  	
    5.55  	return if_eth0;
    5.56  }
    5.57 +*/
    5.58  
    5.59  /** This function retrieves the local hostname of the 
    5.60   * client machine.
    5.61 @@ -246,7 +251,7 @@
    5.62      gint res = gethostname (hname, 50);
    5.63  
    5.64      if (res == -1) {
    5.65 -	g_debug ("Error while getting hostname");
    5.66 +	gmyth_debug ("Error while getting hostname");
    5.67  	return NULL;
    5.68      }
    5.69  
    5.70 @@ -274,7 +279,7 @@
    5.71      
    5.72      if ( err == EADDRNOTAVAIL )
    5.73      {
    5.74 -    	g_debug( "[%s] Address (%s) not available. (reason = %d)\n", __FUNCTION__, localhostname, err );
    5.75 +    	gmyth_debug( "[%s] Address (%s) not available. (reason = %d)\n", __FUNCTION__, localhostname, err );
    5.76      	return str;
    5.77      }
    5.78      
    5.79 @@ -309,7 +314,7 @@
    5.80          gchar *prim_addr = gmyth_socket_get_primary_addr();
    5.81  
    5.82      	if ( prim_addr != NULL ) {
    5.83 -		g_debug("[%s] Could not determine the local alphanumerical hostname. Setting to %s\n",
    5.84 +		gmyth_debug("[%s] Could not determine the local alphanumerical hostname. Setting to %s\n",
    5.85      	        __FUNCTION__, prim_addr );
    5.86        
    5.87  	        str = g_string_new (prim_addr);
    5.88 @@ -394,14 +399,14 @@
    5.89  	
    5.90  	  saveflags = fcntl( fd, F_GETFL, 0 );
    5.91  	  if( saveflags < 0 ) {
    5.92 -	    g_debug( "[%s] Problems when getting socket flags on fcntl.\n", __FUNCTION__ );
    5.93 +	    gmyth_debug( "[%s] Problems when getting socket flags on fcntl.\n", __FUNCTION__ );
    5.94  	    *err=errno;
    5.95  	    return -1;
    5.96  	  }
    5.97  	
    5.98  	  /* Set non blocking */
    5.99  	  if( fcntl( fd, F_SETFL, saveflags | O_NONBLOCK ) < 0) {
   5.100 -	  	g_debug( "[%s] Problems when setting non-blocking using fcntl.\n", __FUNCTION__ );
   5.101 +	  	gmyth_debug( "[%s] Problems when setting non-blocking using fcntl.\n", __FUNCTION__ );
   5.102  	    *err=errno;
   5.103  	    return -1;
   5.104  	  }
   5.105 @@ -412,7 +417,7 @@
   5.106  	
   5.107  		/* restore flags */
   5.108  	  if( fcntl( fd, F_SETFL, saveflags ) < 0) {
   5.109 -	    g_debug( "[%s] Problems when trying to restore flags with fcntl.\n", __FUNCTION__ );
   5.110 +	    gmyth_debug( "[%s] Problems when trying to restore flags with fcntl.\n", __FUNCTION__ );
   5.111  	    *err=errno;
   5.112  	    return -1;
   5.113  	  }
   5.114 @@ -420,7 +425,7 @@
   5.115  	  /* return unless the connection was successful or the connect is
   5.116  	     still in progress. */
   5.117  	  if( *err < 0 && back_err != EINPROGRESS) {
   5.118 -	    g_debug( "[%s] Connection unsucessfully (it is not in progress).\n", __FUNCTION__ );
   5.119 +	    gmyth_debug( "[%s] Connection unsucessfully (it is not in progress).\n", __FUNCTION__ );
   5.120  	    *err = errno;
   5.121  	    return -1;
   5.122  	  }
   5.123 @@ -430,14 +435,14 @@
   5.124  	
   5.125  	  *err = select( FD_SETSIZE, NULL, &fd_w, NULL, timeout);
   5.126  	  if ( *err < 0 ) {
   5.127 -	    g_debug( "[%s] Connection unsucessfull (timed out).\n", __FUNCTION__ );
   5.128 +	    gmyth_debug( "[%s] Connection unsucessfull (timed out).\n", __FUNCTION__ );
   5.129  	    *err=errno;
   5.130  	    return -1;
   5.131  	  }
   5.132  	
   5.133  	  /* 0 means it timeout out & no fds changed */
   5.134  	  if(*err==0) {
   5.135 -	  	g_debug( "[%s] Connection unsucessfull [%d] - 0 means it timeout out & no fds changed\n", 
   5.136 +	  	gmyth_debug( "[%s] Connection unsucessfull [%d] - 0 means it timeout out & no fds changed\n", 
   5.137  	  				__FUNCTION__, *err );
   5.138  	    close(fd);
   5.139  	    *err=ETIMEDOUT;
   5.140 @@ -449,14 +454,14 @@
   5.141  	  *err=getsockopt( fd, SOL_SOCKET, SO_ERROR, &ret, (socklen_t *) &len);
   5.142  	  
   5.143  	  if( *err < 0 ) {
   5.144 -	    g_debug( "[%s] Connection unsucessfull.\n", __FUNCTION__ );
   5.145 +	    gmyth_debug( "[%s] Connection unsucessfull.\n", __FUNCTION__ );
   5.146  	    *err=errno;
   5.147  	    return -1;
   5.148  	  }
   5.149  	
   5.150  	  /* ret=0 means success, otherwise it contains the errno */
   5.151  	  if (ret) {
   5.152 -	  	g_debug( "[%s] Connection unsucessfull - Couldn't connect to remote host!!!\n", __FUNCTION__ );
   5.153 +	  	gmyth_debug( "[%s] Connection unsucessfull - Couldn't connect to remote host!!!\n", __FUNCTION__ );
   5.154  	    *err=ret;
   5.155  	    return -1;
   5.156  	  }
   5.157 @@ -535,13 +540,13 @@
   5.158          
   5.159          if (gmyth_socket_try_connect (gmyth_socket->sd, (struct sockaddr *)addr_info0->ai_addr,
   5.160                  addr_info0->ai_addrlen, timeout_val, &ret_code ) < 0 ) {
   5.161 -            g_debug( "[%s] Error connecting to backend!\n", __FUNCTION__ );
   5.162 +            gmyth_debug( "[%s] Error connecting to backend!\n", __FUNCTION__ );
   5.163              if (ret_code == ETIMEDOUT)
   5.164 -                g_debug( "[%s]\tBackend host unreachable!\n", __FUNCTION__ );
   5.165 +                gmyth_debug( "[%s]\tBackend host unreachable!\n", __FUNCTION__ );
   5.166  
   5.167              close (gmyth_socket->sd);
   5.168              gmyth_socket->sd = -1;
   5.169 -            g_debug ("ERROR: %s\n", gai_strerror(ret_code));
   5.170 +            gmyth_debug ("ERROR: %s\n", gai_strerror(ret_code));
   5.171      	    g_free (timeout_val);
   5.172              continue;
   5.173          }
   5.174 @@ -567,7 +572,7 @@
   5.175      err = setsockopt(gmyth_socket->sd, SOL_SOCKET, SO_LINGER, ling, sizeof(struct linger));
   5.176  	  
   5.177      if( err < 0 ) {
   5.178 -        g_debug( "[%s] Setting connection unsucessfull.\n", __FUNCTION__ );
   5.179 +        gmyth_debug( "[%s] Setting connection unsucessfull.\n", __FUNCTION__ );
   5.180  	    err=errno;
   5.181          ret = FALSE;
   5.182          goto cleanup;
   5.183 @@ -623,7 +628,7 @@
   5.184      GIOCondition io_cond = g_io_channel_get_buffer_condition( gmyth_socket->sd_io_ch );
   5.185  
   5.186      if ( ( io_cond & G_IO_IN ) == 0 ) {
   5.187 -	g_debug ("[%s] IO channel is not able to send data!\n", __FUNCTION__);
   5.188 +	gmyth_debug ("[%s] IO channel is not able to send data!\n", __FUNCTION__);
   5.189  	ret = FALSE;
   5.190      }
   5.191  
   5.192 @@ -645,7 +650,7 @@
   5.193      GIOCondition io_cond = g_io_channel_get_buffer_condition( gmyth_socket->sd_io_ch );
   5.194  
   5.195      if ( ( ( io_cond & G_IO_OUT ) == 0 ) || ( ( io_cond & G_IO_HUP ) == 0 ) ) {
   5.196 -	g_debug ("[%s] IO channel is not able to send data!\n", __FUNCTION__);
   5.197 +	gmyth_debug ("[%s] IO channel is not able to send data!\n", __FUNCTION__);
   5.198  	ret = FALSE;
   5.199      }
   5.200  
   5.201 @@ -674,7 +679,7 @@
   5.202      g_return_val_if_fail( gmyth_socket->sd_io_ch != NULL, FALSE );
   5.203  
   5.204      if( command == NULL || ( command->len <= 0 ) || command->str == NULL ) {
   5.205 -		g_debug ("[%s] Invalid NULL command parameter!\n", __FUNCTION__);
   5.206 +		gmyth_debug ("[%s] Invalid NULL command parameter!\n", __FUNCTION__);
   5.207  		ret = FALSE;
   5.208  		goto done;
   5.209      }
   5.210 @@ -693,10 +698,10 @@
   5.211  
   5.212  
   5.213      if( (io_status == G_IO_STATUS_ERROR) || ( bytes_written <= 0 ) ) {
   5.214 -		g_debug ("[%s] Error while writing to socket", __FUNCTION__);
   5.215 +		gmyth_debug ("[%s] Error while writing to socket", __FUNCTION__);
   5.216  		ret = FALSE;
   5.217      } else if ( bytes_written < command->len ) {
   5.218 -		g_debug ("[%s] Not all data was written socket", __FUNCTION__);
   5.219 +		gmyth_debug ("[%s] Not all data was written socket", __FUNCTION__);
   5.220  		ret = FALSE;
   5.221      }
   5.222  
   5.223 @@ -704,7 +709,7 @@
   5.224  
   5.225      if ( ( bytes_written != command->len ) || ( io_status == G_IO_STATUS_ERROR ) )
   5.226      {
   5.227 -		g_debug ("[%s] Some problem occurred when sending data to the socket\n", __FUNCTION__);
   5.228 +		gmyth_debug ("[%s] Some problem occurred when sending data to the socket\n", __FUNCTION__);
   5.229  	
   5.230  		ret = TRUE;
   5.231      }
   5.232 @@ -712,7 +717,7 @@
   5.233      g_mutex_unlock( gmyth_socket->mutex );
   5.234  done:
   5.235      if ( error != NULL ) {
   5.236 -		g_debug( "[%s] Error found reading data from IO channel: (%d, %s)\n", __FUNCTION__, error->code, error->message );
   5.237 +		gmyth_debug( "[%s] Error found reading data from IO channel: (%d, %s)\n", __FUNCTION__, error->code, error->message );
   5.238  		ret = FALSE;
   5.239  		g_error_free( error );
   5.240      }
   5.241 @@ -739,7 +744,7 @@
   5.242  	gboolean with_events)
   5.243  {
   5.244      if (!gmyth_socket_connect (gmyth_socket, hostname_backend, port)) {
   5.245 -		g_debug ("[%s] Could not open socket to backend machine [%s]\n", __FUNCTION__,
   5.246 +		gmyth_debug ("[%s] Could not open socket to backend machine [%s]\n", __FUNCTION__,
   5.247  					hostname_backend );
   5.248  		return FALSE;
   5.249      }
   5.250 @@ -751,7 +756,7 @@
   5.251  
   5.252          hostname = gmyth_socket_get_local_hostname();
   5.253          if (hostname == NULL) {
   5.254 -            g_debug ("Hostname not available, setting to n800frontend\n");
   5.255 +            gmyth_debug ("Hostname not available, setting to n800frontend\n");
   5.256              hostname = g_string_new ("n800frontend");
   5.257          }
   5.258          
   5.259 @@ -772,7 +777,7 @@
   5.260          
   5.261          return TRUE;
   5.262      } else {
   5.263 -        g_debug ("[%s] GMythSocket could not connect to the backend", __FUNCTION__);
   5.264 +        gmyth_debug ("[%s] GMythSocket could not connect to the backend", __FUNCTION__);
   5.265          return FALSE;
   5.266      }
   5.267  }
   5.268 @@ -837,7 +842,7 @@
   5.269  	*/
   5.270  
   5.271    if (gmyth_socket->sd_io_ch != NULL) {
   5.272 -  	//g_io_channel_shutdown (gmyth_socket->sd_io_ch, TRUE, NULL);
   5.273 +  	g_io_channel_shutdown (gmyth_socket->sd_io_ch, TRUE, NULL);
   5.274      g_io_channel_unref (gmyth_socket->sd_io_ch);
   5.275      gmyth_socket->sd_io_ch = NULL;
   5.276      gmyth_socket->sd = -1;
   5.277 @@ -874,14 +879,14 @@
   5.278      response = gmyth_socket_receive_response(gmyth_socket);
   5.279  
   5.280      if (response == NULL) {
   5.281 -		g_debug ("[%s] Check protocol version error! Not answered!", __FUNCTION__);
   5.282 +		gmyth_debug ("[%s] Check protocol version error! Not answered!", __FUNCTION__);
   5.283  		res = FALSE;	
   5.284  		goto done;
   5.285      }
   5.286  
   5.287      res = g_str_has_prefix (response->str, "ACCEPT");
   5.288      if (!res) {
   5.289 -        g_debug ("[%s] Protocol version request error: %s", __FUNCTION__, response->str);
   5.290 +        gmyth_debug ("[%s] Protocol version request error: %s", __FUNCTION__, response->str);
   5.291          /* get the version number returned by the REJECT message */
   5.292          if ( ( res = g_str_has_prefix (response->str, "REJECT") ) == TRUE ) {
   5.293              gchar *new_version = NULL;
   5.294 @@ -998,7 +1003,7 @@
   5.295      gmyth_debug ( "[%s] Bytes read = %d\n", __FUNCTION__, bytes_read );
   5.296  
   5.297      if( (io_status == G_IO_STATUS_ERROR) || (bytes_read <= 0) ) {
   5.298 -        g_debug ("[%s] Error in mythprotocol response from backend\n", __FUNCTION__);
   5.299 +        gmyth_debug ("[%s] Error in mythprotocol response from backend\n", __FUNCTION__);
   5.300      	str = NULL;
   5.301  	    //return NULL;
   5.302      } else if ( buffer != NULL && strlen(buffer) > 0 ) {
   5.303 @@ -1049,7 +1054,7 @@
   5.304          str = g_string_new (buffer);
   5.305  
   5.306      if ( error != NULL ) {
   5.307 -        g_debug( "[%s] Error found receiving response from the IO channel: (%d, %s)\n",
   5.308 +        gmyth_debug( "[%s] Error found receiving response from the IO channel: (%d, %s)\n",
   5.309                  __FUNCTION__, error->code, error->message );
   5.310          str = NULL;
   5.311          g_error_free (error);
     6.1 --- a/gmyth/src/gmyth_transcoder.c	Tue Mar 27 21:31:34 2007 +0100
     6.2 +++ b/gmyth/src/gmyth_transcoder.c	Tue Mar 27 21:42:35 2007 +0100
     6.3 @@ -226,9 +226,9 @@
     6.4  	}
     6.5          trans->started = gmyth_jobqueue_add_job(trans, "JOB_TRANSCODE");
     6.6  	if (trans->started == FALSE)
     6.7 -	    g_debug ("Error while starting GMythTranscoder to file: %s", trans->output_filename);
     6.8 +	    gmyth_debug ("Error while starting GMythTranscoder to file: %s", trans->output_filename);
     6.9      } else {
    6.10 -	g_debug ("GMythTransfer already started!");
    6.11 +	    gmyth_debug ("GMythTransfer already started!");
    6.12      }
    6.13  
    6.14      return trans->started;