# HG changeset patch # User rosfran # Date 1165274024 0 # Node ID 418267061bed69145bd195a1da33d3979270e02f # Parent b13b1e81f5afcda9357a162643085439db38f2e9 [svn r194] Some fixes on chain function. diff -r b13b1e81f5af -r 418267061bed gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c --- a/gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c Mon Dec 04 23:07:36 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); }