[svn r235] Added filters to some MythTV backend messages. trunk
authorrosfran
Wed Dec 20 14:25:38 2006 +0000 (2006-12-20)
branchtrunk
changeset 234803a006ca678
parent 233 1cf29cf20fb3
child 235 a7a8a3b4182e
[svn r235] Added filters to some MythTV backend messages.
gmyth/src/gmyth_file_transfer.c
gmyth/src/gmyth_livetv.c
gmyth/src/gmyth_monitor_handler.c
     1.1 --- a/gmyth/src/gmyth_file_transfer.c	Wed Dec 20 01:03:38 2006 +0000
     1.2 +++ b/gmyth/src/gmyth_file_transfer.c	Wed Dec 20 14:25:38 2006 +0000
     1.3 @@ -596,36 +596,6 @@
     1.4  	        gmyth_debug ("Total transfer data read: %d\n", total_read);
     1.5          }
     1.6          g_free (data_buffer);
     1.7 -	    } else {
     1.8 -				transfer->priv = GMYTH_FILE_TRANSFER_GET_PRIVATE(transfer);
     1.9 -				
    1.10 -				if ( transfer->priv != NULL && transfer->priv->livetv != NULL )
    1.11 -				{
    1.12 -				
    1.13 -					total_read = GMYTHTV_FILE_TRANSFER_NEXT_PROG_CHAIN;	
    1.14 -				
    1.15 -			  	if ( transfer->priv->do_next_program_chain )
    1.16 -			  	{			  					  		
    1.17 -			  		
    1.18 -			  		g_mutex_lock( transfer->mutex );
    1.19 -			  		
    1.20 -			  		ret = gmyth_livetv_next_program_chain( transfer->priv->livetv );
    1.21 -			  		
    1.22 -			  		g_mutex_unlock( transfer->mutex );
    1.23 -			  		
    1.24 -						if ( !ret )
    1.25 -						{
    1.26 -							gmyth_debug( "Cannot change to the next program chain!" );
    1.27 -						}
    1.28 -						else
    1.29 -						{
    1.30 -							gmyth_debug( "OK!!! MOVED to the next program chain [%s]!", 
    1.31 -													(gmyth_tvchain_get_id( transfer->priv->livetv->tvchain ))->str );
    1.32 -						}
    1.33 -						
    1.34 -			  	}
    1.35 -			  	
    1.36 -				} /* if */
    1.37        } /* if */
    1.38      } else {
    1.39      	total_read = GMYTHTV_FILE_TRANSFER_READ_ERROR;
    1.40 @@ -637,6 +607,32 @@
    1.41      strlist = NULL;
    1.42    }
    1.43    
    1.44 +  if ( bytes_sent == 0 && max_tries == 0 ) 
    1.45 +	{
    1.46 +		gmyth_debug( "Trying to move to the next program chain..." );
    1.47 +		transfer->priv = GMYTH_FILE_TRANSFER_GET_PRIVATE(transfer);
    1.48 +		
    1.49 +		if ( transfer->priv != NULL && transfer->priv->livetv != NULL &&
    1.50 +					transfer->priv->do_next_program_chain )
    1.51 +		{
    1.52 +		
    1.53 +			total_read = GMYTHTV_FILE_TRANSFER_NEXT_PROG_CHAIN;	
    1.54 +		
    1.55 +	  		g_mutex_lock( transfer->mutex );
    1.56 +	  		
    1.57 +	  		ret = gmyth_livetv_next_program_chain( transfer->priv->livetv );
    1.58 +	  		
    1.59 +	  		g_mutex_unlock( transfer->mutex );
    1.60 +  		
    1.61 +			if ( !ret )
    1.62 +				gmyth_debug( "Cannot change to the next program chain!" );
    1.63 +			else
    1.64 +				gmyth_debug( "OK!!! MOVED to the next program chain [%s]!", 
    1.65 +										(gmyth_tvchain_get_id( transfer->priv->livetv->tvchain ))->str );						
    1.66 +		}
    1.67 +
    1.68 +	} /* if */
    1.69 +  
    1.70    myth_control_release_context( );
    1.71    g_string_free (query, TRUE);
    1.72  
     2.1 --- a/gmyth/src/gmyth_livetv.c	Wed Dec 20 01:03:38 2006 +0000
     2.2 +++ b/gmyth/src/gmyth_livetv.c	Wed Dec 20 14:25:38 2006 +0000
     2.3 @@ -157,21 +157,23 @@
     2.4  		
     2.5  		case GMYTH_BACKEND_PROGRAM_INFO_CHANGED:
     2.6  		{
     2.7 -			gmyth_debug( "LIVETV Program Changed event received [ msg = %s ]\n", message );
     2.8 -			gmyth_debug( "OK!!! MOVED to the next program chain [%s]!", 
     2.9 -									(gmyth_tvchain_get_id( live_tv->tvchain ))->str );
    2.10 -			/* advertises the FileTransfer about the program info changed */
    2.11 -			if ( live_tv->file_transfer != NULL )
    2.12 -			{
    2.13 -				gmyth_debug( "Emitting signal to the FileTransfer... [ \"program-info-changed \" ]" );
    2.14 -				
    2.15 -				gmyth_file_transfer_emit_program_info_changed_signal( live_tv->file_transfer,
    2.16 -	             msg_code, (gpointer)live_tv );
    2.17 -	             
    2.18 -	      //gmyth_livetv_monitor_handler_stop( live_tv );	      
    2.19 -			} else
    2.20 -				gmyth_debug( "LIVETV file_transfer is NULL!!! Cannot move to the next program chain event received.\n");
    2.21 -			/*}*/
    2.22 +			gmyth_debug( "LIVETV Program Changed request received [ msg = %s ]. Watching if the new "\
    2.23 +				"TV Chain ID is the same as the old one...\n", message );
    2.24 +			if ( g_ascii_strcasecmp ( message, (gmyth_tvchain_get_id( live_tv->tvchain ))->str ) != 0 ) {				
    2.25 +				gmyth_debug( "OK!!! MOVED to the next program chain [actual == %s]!", 
    2.26 +										(gmyth_tvchain_get_id( live_tv->tvchain ))->str );
    2.27 +				/* advertises the FileTransfer about the program info changed */
    2.28 +				if ( live_tv->file_transfer != NULL )
    2.29 +				{
    2.30 +					gmyth_debug( "Emitting signal to the FileTransfer... [ \"program-info-changed \" ]" );
    2.31 +					
    2.32 +					gmyth_file_transfer_emit_program_info_changed_signal( live_tv->file_transfer,
    2.33 +		             msg_code, (gpointer)live_tv );
    2.34 +		             
    2.35 +		      //gmyth_livetv_monitor_handler_stop( live_tv );	      
    2.36 +				} else
    2.37 +					gmyth_debug( "LIVETV file_transfer is NULL!!! Cannot move to the next program chain event received.\n");				
    2.38 +			}
    2.39  			break;
    2.40  		}
    2.41  		default:
     3.1 --- a/gmyth/src/gmyth_monitor_handler.c	Wed Dec 20 01:03:38 2006 +0000
     3.2 +++ b/gmyth/src/gmyth_monitor_handler.c	Wed Dec 20 14:25:38 2006 +0000
     3.3 @@ -322,8 +322,8 @@
     3.4    	{	        	
     3.5    	
     3.6      	if ( g_strstr_len( *back_msg_action, strlen( *back_msg_action ), "LIVETV_CHAIN" ) ||
     3.7 -    			g_strstr_len( *back_msg_action, strlen( *back_msg_action ), "RECORDING_LIST_CHANGE" ) ||
     3.8 -    			g_strstr_len( *back_msg_action, strlen( *back_msg_action ), "SCHEDULE_CHANGE" ) ||
     3.9 +    			/* g_strstr_len( *back_msg_action, strlen( *back_msg_action ), "RECORDING_LIST_CHANGE" ) || 
    3.10 +    			g_strstr_len( *back_msg_action, strlen( *back_msg_action ), "SCHEDULE_CHANGE" ) || */
    3.11      			g_strstr_len( *back_msg_action, strlen( *back_msg_action ), "LIVETV_WATCH" ) )
    3.12      	{
    3.13      		gmyth_debug( "MONITOR: message type == GMYTH_BACKEND_PROGRAM_INFO_CHANGED, msg = %s", *back_msg_action );