gmyth-stream/gmemcoder/src/gmencoder.c
branchtrunk
changeset 679 c9757033ccc6
parent 671 a05b421242e4
child 691 726550e48c21
     1.1 --- a/gmyth-stream/gmemcoder/src/gmencoder.c	Wed May 16 18:45:29 2007 +0100
     1.2 +++ b/gmyth-stream/gmemcoder/src/gmencoder.c	Wed May 16 23:53:02 2007 +0100
     1.3 @@ -162,7 +162,7 @@
     1.4      g_mencoder_signals[ERROR] =
     1.5          g_signal_new ("error",
     1.6      		  G_OBJECT_CLASS_TYPE (object_class),
     1.7 -    		  G_SIGNAL_RUN_FIRST,
     1.8 +    		  G_SIGNAL_RUN_LAST,
     1.9      		  0, NULL, NULL,
    1.10      		  g_cclosure_marshal_VOID__STRING,
    1.11      		  G_TYPE_NONE, 1, G_TYPE_STRING);	
    1.12 @@ -246,11 +246,13 @@
    1.13  
    1.14      if (prop != NULL) {
    1.15          for (i=0; i < g_strv_length (prop); i++) {
    1.16 -            char** v = g_strsplit(prop[i], "=", 2);
    1.17 -            if (g_strv_length (v) == 2) {
    1.18 -                _obj_set_prop (G_OBJECT (ret), v[0], v[1]);
    1.19 -            }
    1.20 -            g_strfreev (v);
    1.21 +			if (prop[i] != NULL) {
    1.22 +            	char** v = g_strsplit(prop[i], "=", 2);
    1.23 +            	if (g_strv_length (v) == 2) {
    1.24 +                	_obj_set_prop (G_OBJECT (ret), v[0], v[1]);
    1.25 +            	}	
    1.26 +            	g_strfreev (v);
    1.27 +			}
    1.28          }
    1.29      }
    1.30  
    1.31 @@ -635,16 +637,18 @@
    1.32  	}
    1.33  
    1.34      if (priv->pipe != NULL) { 
    1.35 -        gst_element_set_state (priv->pipe, GST_STATE_NULL);
    1.36 -        gst_object_unref (priv->pipe);
    1.37 +		GstState state;
    1.38 +		GstState pending;		
    1.39 +        //gst_element_set_state (priv->pipe, GST_STATE_NULL);
    1.40 +        //gst_object_unref (priv->pipe);
    1.41 +        gst_object_unref (priv->src);
    1.42 +		priv->src = NULL;
    1.43          priv->pipe = NULL;
    1.44          priv->abin = NULL;
    1.45          priv->vbin = NULL;
    1.46          priv->sink = NULL;
    1.47      }
    1.48      priv->ready = FALSE;
    1.49 -
    1.50 -
    1.51  }
    1.52  
    1.53  static GstElement*
    1.54 @@ -934,16 +938,23 @@
    1.55  		    GError *error;
    1.56  		    gchar *debug;
    1.57  		    gchar *err_str;
    1.58 +
    1.59 +			if (priv->tick_id != 0) {			
    1.60 +				g_source_remove (priv->tick_id);
    1.61 +				priv->tick_id = 0;
    1.62 +			}
    1.63  		    
    1.64  		    gst_message_parse_error (msg, &error, &debug);
    1.65  		    err_str = g_strdup_printf ("Error [%d] %s (%s)", error->code,
    1.66  		        error->message,
    1.67  		        debug);
    1.68 +			g_debug ("%s", err_str);
    1.69 +            priv->ready = FALSE;
    1.70  		    g_signal_emit (user_data, g_mencoder_signals[ERROR], 0, err_str);
    1.71 -            priv->ready = FALSE;
    1.72  		    g_free (err_str);
    1.73  		    g_clear_error (&error);
    1.74  		    g_free (debug);
    1.75 +			g_debug ("ERROR DONE");
    1.76  		    break;
    1.77  		}
    1.78