# HG changeset patch # User rosfran # Date 1166640871 0 # Node ID d7fb0e36deff92166ade28c161dfd74e5bde2ef8 # Parent a7a8a3b4182eef082fd19402690a231301c97e4e [svn r237] Added channel info. diff -r a7a8a3b4182e -r d7fb0e36deff gst-plugins-mythtv/src/gstmythtvsrc.c --- a/gst-plugins-mythtv/src/gstmythtvsrc.c Wed Dec 20 14:43:11 2006 +0000 +++ b/gst-plugins-mythtv/src/gstmythtvsrc.c Wed Dec 20 18:54:31 2006 +0000 @@ -42,7 +42,7 @@ #define GST_GMYTHTV_ID_NUM 1 -#define GST_GMYTHTV_CHANNEL_NUM 1000 +#define GST_GMYTHTV_CHANNEL_DEFAULT_NUM -1 #define GMYTHTV_VERSION_DEFAULT 30 @@ -225,7 +225,7 @@ (gobject_class, PROP_GMYTHTV_CHANNEL_NUM, g_param_spec_int ("mythtv-channel", "mythtv-channel", "Change MythTV channel number", - 0, 99999, GST_GMYTHTV_CHANNEL_NUM, G_PARAM_READWRITE)); + 0, 99999, GST_GMYTHTV_CHANNEL_DEFAULT_NUM, G_PARAM_READWRITE)); #ifndef GST_DISABLE_GST_DEBUG g_object_class_install_property @@ -278,7 +278,7 @@ this->mythtv_caps = NULL; this->update_prog_chain = FALSE; - this->channel_num = 0; + this->channel_num = GST_GMYTHTV_CHANNEL_DEFAULT_NUM; this->eos = FALSE; @@ -662,11 +662,21 @@ src->backend_info = gmyth_backend_info_new_with_uri( src->uri_name ); if ( src->live_tv ) { src->spawn_livetv = gmyth_livetv_new( ); - if ( gmyth_livetv_setup( src->spawn_livetv, src->backend_info ) == FALSE ) { - GST_INFO_OBJECT( src, "[%s] LiveTV setup felt down on error!!\n", __FUNCTION__ ); - ret = FALSE; - goto init_failed; - } + + if ( src->channel_num != GST_GMYTHTV_CHANNEL_DEFAULT_NUM ) + { + if ( gmyth_livetv_channel_setup( src->spawn_livetv, src->channel_num, src->backend_info ) == FALSE ) { + GST_INFO_OBJECT( src, "[%s] LiveTV setup felt down on error!!\n", __FUNCTION__ ); + ret = FALSE; + goto init_failed; + } + } else { + if ( gmyth_livetv_setup( src->spawn_livetv, src->backend_info ) == FALSE ) { + GST_INFO_OBJECT( src, "[%s] LiveTV setup felt down on error!!\n", __FUNCTION__ ); + ret = FALSE; + goto init_failed; + } + } src->file_transfer = gmyth_livetv_create_file_transfer(src->spawn_livetv);