[svn r786] fixed some bugs on destructor trunk
authorrenatofilho
Wed Jul 04 15:25:52 2007 +0100 (2007-07-04)
branchtrunk
changeset 7807feaeeed26d5
parent 779 938f13e4a376
child 781 97fd2d4783bf
[svn r786] fixed some bugs on destructor
gmyth-stream/gmemcoder/src/gmencoder.c
gmyth-stream/gmemcoder/src/main.c
     1.1 --- a/gmyth-stream/gmemcoder/src/gmencoder.c	Wed Jul 04 15:14:22 2007 +0100
     1.2 +++ b/gmyth-stream/gmemcoder/src/gmencoder.c	Wed Jul 04 15:25:52 2007 +0100
     1.3 @@ -676,11 +676,11 @@
     1.4  
     1.5      if (priv->pipe != NULL) {
     1.6          // TODO: fixe pipeline dispose
     1.7 -        // gst_element_set_state (priv->pipe, GST_STATE_NULL);
     1.8 +        gst_element_set_state (priv->pipe, GST_STATE_NULL);
     1.9          // g_debug ("SETING STATE TO NULL: OK");
    1.10          // gst_element_set_state (priv->pipe, GST_STATE_NULL);
    1.11 -        // gst_object_unref (priv->pipe);
    1.12 -        gst_object_unref(priv->src);
    1.13 +        gst_object_unref (priv->pipe);
    1.14 +        //gst_object_unref(priv->src);
    1.15          priv->src = NULL;
    1.16          priv->pipe = NULL;
    1.17          priv->abin = NULL;
    1.18 @@ -1171,22 +1171,24 @@
    1.19  {
    1.20      GMencoderPrivate *priv = G_MENCODER_GET_PRIVATE(user_data);
    1.21  
    1.22 +    if (GST_BUFFER_SIZE (buff) == 0)
    1.23 +        return;
    1.24 +
    1.25      if (BUFFER_SIZE == 0) {
    1.26 -	if (_send_buffer (priv->fd, GST_BUFFER_DATA (buff), GST_BUFFER_SIZE (buff)) == FALSE)
    1.27 +	    if (_send_buffer (priv->fd, GST_BUFFER_DATA (buff), GST_BUFFER_SIZE (buff)) == FALSE)
    1.28               goto error;
    1.29          return;
    1.30      }
    1.31  
    1.32      priv->queue = g_byte_array_append (priv->queue, GST_BUFFER_DATA (buff), GST_BUFFER_SIZE (buff));
    1.33      while (priv->queue->len >= BUFFER_SIZE) {
    1.34 -    	//g_usleep (0.2 * G_USEC_PER_SEC);
    1.35 -    	if (priv->send_chunked) {	
    1.36 -	    if (_send_buffer (priv->fd, priv->queue->data, BUFFER_SIZE) == FALSE)
    1.37 +    	if (priv->send_chunked) {
    1.38 +            if (_send_buffer (priv->fd, priv->queue->data, BUFFER_SIZE) == FALSE)
    1.39                  goto error;
    1.40 -	} else {
    1.41 -	    if (write (priv->fd, priv->queue->data, BUFFER_SIZE) == -1)
    1.42 +        } else {
    1.43 +	        if (write (priv->fd, priv->queue->data, BUFFER_SIZE) == -1)
    1.44                  goto error;
    1.45 -	}
    1.46 +	    }
    1.47          priv->queue = g_byte_array_remove_range (priv->queue, 0, BUFFER_SIZE);
    1.48      }
    1.49      return;
     2.1 --- a/gmyth-stream/gmemcoder/src/main.c	Wed Jul 04 15:14:22 2007 +0100
     2.2 +++ b/gmyth-stream/gmemcoder/src/main.c	Wed Jul 04 15:25:52 2007 +0100
     2.3 @@ -34,7 +34,7 @@
     2.4  static          gboolean
     2.5  _quit(gpointer data)
     2.6  {
     2.7 -    g_object_unref(data);
     2.8 +    //g_object_unref(data);
     2.9      g_main_loop_quit(mainloop);
    2.10      return FALSE;
    2.11  }