# HG changeset patch # User rosfran # Date 1169232767 0 # Node ID dde6d4e8b881a9d12af69b08464c4ee16f3a12c6 # Parent 08c4bc759e7aaec8211ee4a7da3b78b4202511ce [svn r283] Revert back an old version of gmyth_livetv_setup; bug commited yesterday, and was caused by an invalid MythTV database select statement. diff -r 08c4bc759e7a -r dde6d4e8b881 gmyth/src/gmyth_livetv.c --- a/gmyth/src/gmyth_livetv.c Fri Jan 19 18:39:37 2007 +0000 +++ b/gmyth/src/gmyth_livetv.c Fri Jan 19 18:52:47 2007 +0000 @@ -267,6 +267,15 @@ goto error; } + // Creates livetv chain handler + livetv->tvchain = GMYTH_TVCHAIN ( g_object_new(GMYTH_TVCHAIN_TYPE, NULL) ); + gmyth_tvchain_initialize ( livetv->tvchain, livetv->backend_info ); + + if ( livetv->tvchain == NULL || livetv->tvchain->tvchain_id == NULL ) { + res = FALSE; + goto error; + } + // Init remote encoder. Opens its control socket. res = gmyth_recorder_setup(livetv->recorder); if ( !res ) { @@ -287,12 +296,12 @@ //} } - - // Creates livetv chain handler - livetv->tvchain = GMYTH_TVCHAIN ( g_object_new(GMYTH_TVCHAIN_TYPE, NULL) ); - gmyth_tvchain_initialize ( livetv->tvchain, livetv->backend_info ); - if ( livetv->tvchain == NULL || livetv->tvchain->tvchain_id == NULL ) { + // Spawn live tv. Uses the socket to send mythprotocol data to start livetv in the backend (remotelly) + res = gmyth_recorder_spawntv ( livetv->recorder, + gmyth_tvchain_get_id(livetv->tvchain) ); + if (!res) { + g_warning ("[%s] Fail while spawn tv\n", __FUNCTION__); res = FALSE; goto error; } @@ -305,15 +314,6 @@ goto error; } - // Spawn live tv. Uses the socket to send mythprotocol data to start livetv in the backend (remotelly) - res = gmyth_recorder_spawntv ( livetv->recorder, - gmyth_tvchain_get_id(livetv->tvchain) ); - if (!res) { - g_warning ("[%s] Fail while spawn tv\n", __FUNCTION__); - res = FALSE; - goto error; - } - // Get program info from database using chanid and starttime livetv->proginfo = gmyth_tvchain_get_program_at (livetv->tvchain, tvchain_curr_index++ ); if ( livetv->proginfo == NULL ) { @@ -324,7 +324,7 @@ res = TRUE; gmyth_debug ("GMythLiveTV: All requests to backend to start TV were OK. [%s]\n", livetv->proginfo->pathname->str ); } - + if ( !gmyth_livetv_monitor_handler_start( livetv ) ) { res = FALSE;