gst-plugins-mythtv/src/gstmythtvsrc.c
branchtrunk
changeset 123 253b9171a703
parent 114 04cead6ae39b
child 124 d2d5fe1c3997
     1.1 --- a/gst-plugins-mythtv/src/gstmythtvsrc.c	Mon Nov 27 19:24:43 2006 +0000
     1.2 +++ b/gst-plugins-mythtv/src/gstmythtvsrc.c	Tue Nov 28 00:53:25 2006 +0000
     1.3 @@ -24,8 +24,6 @@
     1.4  #include <gmyth/gmyth_socket.h>
     1.5  #include <gmyth/gmyth_tvchain.h>
     1.6  
     1.7 -#include <gmyth/gmyth_context.h>
     1.8 -
     1.9  #include <string.h>
    1.10  #include <unistd.h>
    1.11  
    1.12 @@ -311,6 +309,11 @@
    1.13      g_object_unref (this->spawn_livetv);
    1.14      this->spawn_livetv = NULL;
    1.15    }
    1.16 +  
    1.17 +  if (this->backend_info) {
    1.18 +    g_object_unref (this->backend_info);
    1.19 +    this->backend_info = NULL;
    1.20 +  }
    1.21  
    1.22    if (this->uri_name) {
    1.23      g_free (this->uri_name);
    1.24 @@ -404,11 +407,12 @@
    1.25    GST_DEBUG_OBJECT( src, "[%s] offset = %llu, size = %d...\n", __FUNCTION__, 
    1.26    		src->read_offset, MAX_READ_SIZE );
    1.27  
    1.28 -  GST_DEBUG_OBJECT ( src, "[%s]\t\tCreate: buffer_remain: %d\n", __FUNCTION__, 
    1.29 -      (gint) src->buffer_remain);
    1.30 +  GST_DEBUG_OBJECT ( src, "[%s]\t\tCreate: buffer_remain: %d, buffer_size = %d.\n", __FUNCTION__, 
    1.31 +      (gint) src->buffer_remain, src->bytes_queue->len );
    1.32  
    1.33    /* just get from the byte array, no network effort... */
    1.34    if ( ( src->buffer_remain = src->bytes_queue->len ) < MAX_READ_SIZE ) {
    1.35 +  //if ( src->buffer_remain  ) {
    1.36    	guint buffer_size_inter = INTERNAL_BUFFER_SIZE - src->buffer_remain;
    1.37    	GByteArray *buffer = g_byte_array_new();
    1.38  
    1.39 @@ -641,9 +645,9 @@
    1.40    }
    1.41  
    1.42    if ( src->live_tv ) {
    1.43 -  	//gmyth_context_initialize();
    1.44 +  	src->backend_info = gmyth_backend_info_new_with_uri( src->uri_name );
    1.45      src->spawn_livetv = gmyth_livetv_new( );
    1.46 -    if ( gmyth_livetv_setup( src->spawn_livetv ) == FALSE ) {
    1.47 +    if ( gmyth_livetv_setup( src->spawn_livetv, src->backend_info ) == FALSE ) {
    1.48        ret = FALSE;
    1.49        goto init_failed;
    1.50      }    
    1.51 @@ -655,8 +659,8 @@
    1.52        src->live_chain_id = g_strdup( chain_id_local->str );
    1.53        GST_INFO_OBJECT( src, "\t[%s]\tLocal chain ID = %s.\n", __FUNCTION__, src->live_chain_id );      
    1.54      }
    1.55 -    if ( src->uri_name == NULL || strlen( src->uri_name ) <= 0 )
    1.56 -    	gmyth_context_initialize();
    1.57 +    //if ( src->uri_name == NULL || strlen( src->uri_name ) <= 0 )
    1.58 +    //	gmyth_context_initialize();
    1.59      	
    1.60      src->live_tv_id = src->spawn_livetv->recorder->recorder_num;
    1.61      GST_LOG_OBJECT( src, "[%s] LiveTV id = %d, URI path = %s.\n", __FUNCTION__, src->live_tv_id, src->uri_name );