diff -r f61807a4a51c -r 418267061bed gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c --- a/gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c Mon Dec 04 14:01:20 2006 +0000 +++ b/gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c Mon Dec 04 23:13:44 2006 +0000 @@ -1082,8 +1082,18 @@ res = gst_pad_activate_push (sinkpad, TRUE); return res; if (gst_pad_check_pull_range (sinkpad)) { + if (nuv->priv->adapter) { + gst_adapter_clear (nuv->priv->adapter); + g_object_unref (nuv->priv->adapter); + nuv->priv->adapter = NULL; + } res = gst_pad_activate_pull (sinkpad, TRUE); } else { + if (nuv->priv->adapter) { + gst_adapter_clear (nuv->priv->adapter); + } else { + nuv->priv->adapter = gst_adapter_new (); + } res = gst_pad_activate_push (sinkpad, TRUE); } @@ -1203,9 +1213,15 @@ GstNuvDemux *nuv = GST_NUV_DEMUX (gst_pad_get_parent (pad)); GST_DEBUG_OBJECT (nuv, " gst_nuv_demux_chain function"); + + if (NULL == nuv->priv->adapter) { + GST_ERROR ("pull expected! Chain func should not be called"); + return GST_FLOW_UNEXPECTED; + } + gst_adapter_push (nuv->priv->adapter, buf); - gst_object_unref (nuv); + /* gst_object_unref (nuv); */ return gst_nuv_demux_play (pad); }