[svn r283] Revert back an old version of gmyth_livetv_setup; bug commited yesterday, and was caused by an invalid MythTV database select statement.
1.1 --- a/gmyth/src/gmyth_livetv.c Fri Jan 19 18:39:37 2007 +0000
1.2 +++ b/gmyth/src/gmyth_livetv.c Fri Jan 19 18:52:47 2007 +0000
1.3 @@ -267,6 +267,15 @@
1.4 goto error;
1.5 }
1.6
1.7 + // Creates livetv chain handler
1.8 + livetv->tvchain = GMYTH_TVCHAIN ( g_object_new(GMYTH_TVCHAIN_TYPE, NULL) );
1.9 + gmyth_tvchain_initialize ( livetv->tvchain, livetv->backend_info );
1.10 +
1.11 + if ( livetv->tvchain == NULL || livetv->tvchain->tvchain_id == NULL ) {
1.12 + res = FALSE;
1.13 + goto error;
1.14 + }
1.15 +
1.16 // Init remote encoder. Opens its control socket.
1.17 res = gmyth_recorder_setup(livetv->recorder);
1.18 if ( !res ) {
1.19 @@ -287,12 +296,12 @@
1.20 //}
1.21
1.22 }
1.23 -
1.24 - // Creates livetv chain handler
1.25 - livetv->tvchain = GMYTH_TVCHAIN ( g_object_new(GMYTH_TVCHAIN_TYPE, NULL) );
1.26 - gmyth_tvchain_initialize ( livetv->tvchain, livetv->backend_info );
1.27
1.28 - if ( livetv->tvchain == NULL || livetv->tvchain->tvchain_id == NULL ) {
1.29 + // Spawn live tv. Uses the socket to send mythprotocol data to start livetv in the backend (remotelly)
1.30 + res = gmyth_recorder_spawntv ( livetv->recorder,
1.31 + gmyth_tvchain_get_id(livetv->tvchain) );
1.32 + if (!res) {
1.33 + g_warning ("[%s] Fail while spawn tv\n", __FUNCTION__);
1.34 res = FALSE;
1.35 goto error;
1.36 }
1.37 @@ -305,15 +314,6 @@
1.38 goto error;
1.39 }
1.40
1.41 - // Spawn live tv. Uses the socket to send mythprotocol data to start livetv in the backend (remotelly)
1.42 - res = gmyth_recorder_spawntv ( livetv->recorder,
1.43 - gmyth_tvchain_get_id(livetv->tvchain) );
1.44 - if (!res) {
1.45 - g_warning ("[%s] Fail while spawn tv\n", __FUNCTION__);
1.46 - res = FALSE;
1.47 - goto error;
1.48 - }
1.49 -
1.50 // Get program info from database using chanid and starttime
1.51 livetv->proginfo = gmyth_tvchain_get_program_at (livetv->tvchain, tvchain_curr_index++ );
1.52 if ( livetv->proginfo == NULL ) {
1.53 @@ -324,7 +324,7 @@
1.54 res = TRUE;
1.55 gmyth_debug ("GMythLiveTV: All requests to backend to start TV were OK. [%s]\n", livetv->proginfo->pathname->str );
1.56 }
1.57 -
1.58 +
1.59 if ( !gmyth_livetv_monitor_handler_start( livetv ) )
1.60 {
1.61 res = FALSE;