# HG changeset patch # User renatofilho # Date 1183559152 -3600 # Node ID 7feaeeed26d5d6a6494e11a5d2678bc0cde3896b # Parent 938f13e4a3760198c5bc62d46e4cba960e2f46c0 [svn r786] fixed some bugs on destructor diff -r 938f13e4a376 -r 7feaeeed26d5 gmyth-stream/gmemcoder/src/gmencoder.c --- a/gmyth-stream/gmemcoder/src/gmencoder.c Wed Jul 04 15:14:22 2007 +0100 +++ b/gmyth-stream/gmemcoder/src/gmencoder.c Wed Jul 04 15:25:52 2007 +0100 @@ -676,11 +676,11 @@ if (priv->pipe != NULL) { // TODO: fixe pipeline dispose - // gst_element_set_state (priv->pipe, GST_STATE_NULL); + gst_element_set_state (priv->pipe, GST_STATE_NULL); // g_debug ("SETING STATE TO NULL: OK"); // gst_element_set_state (priv->pipe, GST_STATE_NULL); - // gst_object_unref (priv->pipe); - gst_object_unref(priv->src); + gst_object_unref (priv->pipe); + //gst_object_unref(priv->src); priv->src = NULL; priv->pipe = NULL; priv->abin = NULL; @@ -1171,22 +1171,24 @@ { GMencoderPrivate *priv = G_MENCODER_GET_PRIVATE(user_data); + if (GST_BUFFER_SIZE (buff) == 0) + return; + if (BUFFER_SIZE == 0) { - if (_send_buffer (priv->fd, GST_BUFFER_DATA (buff), GST_BUFFER_SIZE (buff)) == FALSE) + if (_send_buffer (priv->fd, GST_BUFFER_DATA (buff), GST_BUFFER_SIZE (buff)) == FALSE) goto error; return; } priv->queue = g_byte_array_append (priv->queue, GST_BUFFER_DATA (buff), GST_BUFFER_SIZE (buff)); while (priv->queue->len >= BUFFER_SIZE) { - //g_usleep (0.2 * G_USEC_PER_SEC); - if (priv->send_chunked) { - if (_send_buffer (priv->fd, priv->queue->data, BUFFER_SIZE) == FALSE) + if (priv->send_chunked) { + if (_send_buffer (priv->fd, priv->queue->data, BUFFER_SIZE) == FALSE) goto error; - } else { - if (write (priv->fd, priv->queue->data, BUFFER_SIZE) == -1) + } else { + if (write (priv->fd, priv->queue->data, BUFFER_SIZE) == -1) goto error; - } + } priv->queue = g_byte_array_remove_range (priv->queue, 0, BUFFER_SIZE); } return; diff -r 938f13e4a376 -r 7feaeeed26d5 gmyth-stream/gmemcoder/src/main.c --- a/gmyth-stream/gmemcoder/src/main.c Wed Jul 04 15:14:22 2007 +0100 +++ b/gmyth-stream/gmemcoder/src/main.c Wed Jul 04 15:25:52 2007 +0100 @@ -34,7 +34,7 @@ static gboolean _quit(gpointer data) { - g_object_unref(data); + //g_object_unref(data); g_main_loop_quit(mainloop); return FALSE; }