# HG changeset patch # User renatofilho # Date 1179355982 -3600 # Node ID c9757033ccc6901a12a424a5f3be864df25e1e2a # Parent 89bdaa9e72bf6dd5484b671efaf2da45c5c270d3 [svn r685] fixed destructor diff -r 89bdaa9e72bf -r c9757033ccc6 gst-gmyth/mythsrc/gstmythtvsrc.c --- a/gst-gmyth/mythsrc/gstmythtvsrc.c Wed May 16 23:52:37 2007 +0100 +++ b/gst-gmyth/mythsrc/gstmythtvsrc.c Wed May 16 23:53:02 2007 +0100 @@ -332,6 +332,8 @@ { mythtv_src->unique_setup = FALSE; + g_debug ("CLEAR"); + if (mythtv_src->spawn_livetv) { g_object_unref (mythtv_src->spawn_livetv); mythtv_src->spawn_livetv = NULL; @@ -351,6 +353,9 @@ g_byte_array_free (mythtv_src->bytes_queue, TRUE); mythtv_src->bytes_queue = NULL; } + + + g_debug ("CLEAR END"); } @@ -717,11 +722,27 @@ src->channel_name = ch; if (src->channel_name != NULL) { - if (gmyth_livetv_channel_name_setup (src->spawn_livetv, src->channel_name) == FALSE) { - GST_INFO_OBJECT (src, "LiveTV setup felt down on error"); - ret = FALSE; - goto init_failed; + gint try = 0; + gboolean result; + + while (try < 100) { + result = gmyth_livetv_channel_name_setup (src->spawn_livetv, src->channel_name); + if (result == TRUE) { + g_debug ("LIVE STARTED"); + break; + } + + g_debug ("FAIL TO START LIVE"); + g_usleep (0.5 * G_USEC_PER_SEC); + try++; } + + if (result == FALSE) { + GST_INFO_OBJECT (src, "LiveTV setup felt down on error"); + ret = FALSE; + goto init_failed; + } + } else { if (gmyth_livetv_setup (src->spawn_livetv) == FALSE) { GST_INFO_OBJECT (src, "LiveTV setup felt down on error"); @@ -837,11 +858,10 @@ src->spawn_livetv = NULL; } - /* GST_ELEMENT_ERROR (src, LIBRARY, INIT, (NULL), ("Could not initialize MythTV library (%i, %s)", ret, src->uri_name)); - */ + gst_mythtv_src_clear (src); @@ -1019,6 +1039,7 @@ switch (transition) { case GST_STATE_CHANGE_READY_TO_NULL: + g_debug ("STAAAAAAAAAAAATTTTTTTTTEEEEEEEEE NULLLLLLLLLLLLLLLL"); gst_mythtv_src_clear (src); break; case GST_STATE_CHANGE_PLAYING_TO_PAUSED: