[svn r218] Simplified FileTransfer usage. trunk
authorrosfran
Tue Dec 12 18:21:08 2006 +0000 (2006-12-12)
branchtrunk
changeset 217aba1e4be0053
parent 216 001205bb0f40
child 218 3d84c6170960
[svn r218] Simplified FileTransfer usage.
gst-plugins-mythtv/src/gstmythtvsrc.c
     1.1 --- a/gst-plugins-mythtv/src/gstmythtvsrc.c	Tue Dec 12 18:19:35 2006 +0000
     1.2 +++ b/gst-plugins-mythtv/src/gstmythtvsrc.c	Tue Dec 12 18:21:08 2006 +0000
     1.3 @@ -48,7 +48,7 @@
     1.4   
     1.5  #define GMYTHTV_TRANSFER_MAX_WAITS		100
     1.6  
     1.7 -#define GMYTHTV_TRANSFER_MAX_RESENDS	5
     1.8 +#define GMYTHTV_TRANSFER_MAX_RESENDS	2
     1.9  
    1.10  #define GMYTHTV_TRANSFER_MAX_BUFFER		128*1024
    1.11  //( 32*1024  )
    1.12 @@ -376,9 +376,11 @@
    1.13        else  
    1.14        {
    1.15  	if ( len == GMYTHTV_FILE_TRANSFER_READ_ERROR ) { /* -314 */
    1.16 -	  src->update_prog_chain = TRUE;
    1.17 +	  //src->update_prog_chain = TRUE;
    1.18  	  goto done;	  	
    1.19 -	} 
    1.20 +	} else if ( len == GMYTHTV_FILE_TRANSFER_NEXT_PROG_CHAIN ) { /* -315 */
    1.21 +	  continue;	  	
    1.22 +	}
    1.23  	goto done;
    1.24        }
    1.25  
    1.26 @@ -680,8 +682,14 @@
    1.27        goto init_failed;
    1.28      }    
    1.29  
    1.30 -    /* set up the uri variable */
    1.31 -    src->uri_name = g_strdup( src->spawn_livetv->proginfo->pathname->str );
    1.32 +    src->file_transfer = gmyth_livetv_create_file_transfer(src->spawn_livetv);
    1.33 +    
    1.34 +    if (NULL == src->file_transfer ) 
    1.35 +	  {
    1.36 +	  	ret = FALSE;
    1.37 +	    goto init_failed;
    1.38 +	  }
    1.39 +		/*
    1.40      chain_id_local = gmyth_tvchain_get_id( src->spawn_livetv->tvchain );
    1.41      if ( chain_id_local != NULL ) {
    1.42        src->live_chain_id = g_strdup( chain_id_local->str );
    1.43 @@ -689,20 +697,21 @@
    1.44      }
    1.45      	
    1.46      src->live_tv_id = src->spawn_livetv->recorder->recorder_num;
    1.47 -    GST_LOG_OBJECT( src, "[%s] LiveTV id = %d, URI path = %s.\n", __FUNCTION__, src->live_tv_id, src->uri_name ); 
    1.48 +    GST_LOG_OBJECT( src, "[%s] LiveTV id = %d, URI path = %s.\n", __FUNCTION__, src->live_tv_id, src->uri_name );
    1.49 +    */ 
    1.50 +  } else {
    1.51 +  	
    1.52 +  	src->file_transfer = gmyth_file_transfer_new( src->backend_info );
    1.53 +
    1.54 +		ret = gmyth_file_transfer_open( src->file_transfer, src->uri_name );
    1.55 +		
    1.56    }
    1.57  
    1.58 -  //src->file_transfer = gmyth_file_transfer_new( src->live_tv_id, 
    1.59 -  //    g_string_new( src->uri_name ), -1, src->mythtv_version );
    1.60 -	src->file_transfer = gmyth_file_transfer_new(src->backend_info);
    1.61 -
    1.62    if ( NULL == src->file_transfer ) 
    1.63    {
    1.64      goto init_failed;
    1.65    }
    1.66 -  GST_INFO_OBJECT( src, "[%s] uri = %s.\n", __FUNCTION__, src->uri_name );
    1.67 -
    1.68 -	ret = gmyth_file_transfer_open( src->file_transfer, src->uri_name );
    1.69 +  /*GST_INFO_OBJECT( src, "[%s] uri = %s.\n", __FUNCTION__, src->spawn_livetv->file_transfer );*/
    1.70  
    1.71    if ( src->live_tv == TRUE && ret == TRUE ) {
    1.72      /* loop finished, set the max tries variable to zero again... */
    1.73 @@ -718,8 +727,6 @@
    1.74  	  sleep( 3 );  
    1.75  
    1.76    }
    1.77 -  /* sets the FileTransfer instance connection (video/audio download) */
    1.78 -  //ret = gmyth_file_transfer_setup( &(src->file_transfer), src->live_tv );
    1.79  
    1.80    if ( ret == FALSE ) {
    1.81  #ifndef GST_DISABLE_GST_DEBUG