diff -r 81cdff5d7452 -r 60c1efd70423 gst-plugins-mythtv/src/gstmythtvsrc.c --- a/gst-plugins-mythtv/src/gstmythtvsrc.c Thu Apr 12 14:59:21 2007 +0100 +++ b/gst-plugins-mythtv/src/gstmythtvsrc.c Fri Apr 13 20:33:36 2007 +0100 @@ -254,7 +254,7 @@ static void gst_mythtv_src_init (GstMythtvSrc * this, GstMythtvSrcClass * g_class) { - this->file_transfer = NULL; + this->file = NULL; this->unique_setup = FALSE; @@ -306,9 +306,9 @@ this->spawn_livetv = NULL; } - if (this->file_transfer) { - g_object_unref (this->file_transfer); - this->file_transfer = NULL; + if (this->file) { + g_object_unref (this->file); + this->file = NULL; } if (this->backend_info) { @@ -346,11 +346,12 @@ * Retry whilst authentication fails and we supply it. */ while (sizetoread == size && --max_iters > 0) { - /*if ( gmyth_backend_info_is_local_file(src->backend_info) ) - result = gmyth_file_local_read ( GMYTH_FILE_LOCAL(src->file_transfer), + /* if ( gmyth_backend_info_is_local_file(src->backend_info) ) */ + if ( IS_GMYTH_FILE_LOCAL(src->file) ) + result = gmyth_file_local_read ( GMYTH_FILE_LOCAL(src->file), data_ptr, sizetoread, src->live_tv); - else*/ - result = gmyth_file_transfer_read ( GMYTH_FILE_TRANSFER(src->file_transfer), + else if ( IS_GMYTH_FILE_TRANSFER(src->file) ) + result = gmyth_file_transfer_read ( GMYTH_FILE_TRANSFER(src->file), data_ptr, sizetoread, src->live_tv); if (data_ptr->len > 0) { @@ -611,12 +612,13 @@ /* verify if it needs to seek */ if (src->read_offset != actual_seek) { - /*if ( gmyth_backend_info_is_local_file(src->backend_info) ) + /* if ( gmyth_backend_info_is_local_file(src->backend_info) ) */ + if ( IS_GMYTH_FILE_LOCAL(src->file) ) new_offset = - gmyth_file_local_seek (src->file_transfer, segment->start, G_SEEK_SET); - else*/ + gmyth_file_local_seek ( GMYTH_FILE_LOCAL(src->file), segment->start, G_SEEK_SET); + else if ( IS_GMYTH_FILE_TRANSFER(src->file) ) new_offset = - gmyth_file_transfer_seek (src->file_transfer, segment->start, SEEK_SET); + gmyth_file_transfer_seek ( GMYTH_FILE_TRANSFER(src->file), segment->start, SEEK_SET); GST_LOG_OBJECT (src, "Segment offset start = %lld, SRC Offset = %lld, NEW actual backend SEEK Offset = %lld.", @@ -640,7 +642,6 @@ eos: { - GST_DEBUG_OBJECT (src, "EOS found on seeking!!!"); return FALSE; } @@ -689,45 +690,45 @@ goto init_failed; } } - + /* testing change channel... */ /* gmyth_recorder_change_channel( src->spawn_livetv->recorder, CHANNEL_DIRECTION_UP ); */ - src->file_transfer = gmyth_livetv_create_file_transfer (src->spawn_livetv); + src->file = GMYTH_FILE( gmyth_livetv_create_file_transfer (src->spawn_livetv) ); - if (NULL == src->file_transfer) { + if (NULL == src->file) { GST_INFO_OBJECT (src, "[LiveTV] FileTransfer equals to NULL"); ret = FALSE; goto init_failed; } - if ( !gmyth_file_transfer_open( src->file_transfer, src->spawn_livetv->uri != NULL ? + if ( !gmyth_file_transfer_open( GMYTH_FILE_TRANSFER(src->file), src->spawn_livetv->uri != NULL ? gmyth_uri_get_path(src->spawn_livetv->uri) : src->spawn_livetv->proginfo->pathname->str ) ) { GST_INFO_OBJECT (src, "Error: couldn't open the FileTransfer from LiveTV source!" ); - g_object_unref( src->file_transfer ); - src->file_transfer = NULL; + g_object_unref( src->file ); + src->file = NULL; goto init_failed; } } else { - /*if ( gmyth_uri_is_local_file(gmyth_uri) ) + if ( gmyth_uri_is_local_file(gmyth_uri) ) { - src->file_transfer = gmyth_file_local_new(src->backend_info); - ret = gmyth_file_local_open (src->file_transfer); - } else {*/ - src->file_transfer = gmyth_file_transfer_new(src->backend_info); - ret = gmyth_file_transfer_open (src->file_transfer, src->uri_name); - //} + src->file = GMYTH_FILE(gmyth_file_local_new(src->backend_info)); + ret = gmyth_file_local_open ( GMYTH_FILE_LOCAL( src->file ) ); + } else { + src->file = GMYTH_FILE(gmyth_file_transfer_new(src->backend_info)); + ret = gmyth_file_transfer_open ( GMYTH_FILE_TRANSFER(src->file), src->uri_name); + } } /* if (else) - recorded FileTransfer */ - if (NULL == src->file_transfer) { + if (NULL == src->file) { GST_INFO_OBJECT (src, "FileTransfer is NULL"); goto init_failed; } - /*GST_INFO_OBJECT( src, "uri = %s", src->spawn_livetv->file_transfer); */ + /*GST_INFO_OBJECT( src, "uri = %s", src->spawn_livetv->file); */ if (ret == FALSE) { #ifndef GST_DISABLE_GST_DEBUG @@ -740,9 +741,9 @@ GST_INFO_OBJECT (src, "MythTV FileTransfer filesize = %lld, content_size = %lld!", - gmyth_file_transfer_get_filesize( src->file_transfer ), src->content_size); + gmyth_file_get_filesize( src->file ), src->content_size); - src->content_size = gmyth_file_transfer_get_filesize (src->file_transfer); + src->content_size = gmyth_file_get_filesize (src->file); src->do_start = FALSE;