diff -r ac7e49c234d8 -r 108aa689d2e5 gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c --- a/gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c Fri Nov 10 19:35:39 2006 +0000 +++ b/gst-plugins-nuvdemux/nuvdemux/gstnuvdemux.c Mon Nov 13 18:36:14 2006 +0000 @@ -87,7 +87,6 @@ GST_PAD_SOMETIMES, GST_STATIC_CAPS_ANY); -/* NUV Demux plug-in time-line functions */ static void gst_nuv_demux_finalize (GObject * object); static GstStateChangeReturn gst_nuv_demux_change_state (GstElement * element, GstStateChange transition); @@ -371,6 +370,7 @@ return res; } +//TODO: create a function to control events and send to src pads static void gst_nuv_demux_create_pads (GstNuvDemux * nuv) { @@ -438,6 +438,7 @@ return ret; } +//TODO: send a new segment event before the firts data static GstFlowReturn gst_nuv_demux_stream_data (GstNuvDemux * nuv) { @@ -762,6 +763,7 @@ gst_pad_push_event (nuv->src_audio_pad, gst_event_new_eos ()); } +//TODO: try use "gst_pad_alloc_buffer" function static GstFlowReturn gst_nuv_demux_read_bytes (GstNuvDemux * nuv, guint64 size, gboolean move, GstBuffer ** buffer) @@ -813,12 +815,6 @@ GstNuvDemux *nuv = GST_NUV_DEMUX (gst_pad_get_parent (sinkpad)); if (gst_pad_check_pull_range (sinkpad)) { - nuv->mode = 0; - if (nuv->adapter) { - gst_adapter_clear (nuv->adapter); - g_object_unref (nuv->adapter); - nuv->adapter = NULL; - } res = gst_pad_activate_pull (sinkpad, TRUE); } else { nuv->mode = 1; @@ -839,6 +835,12 @@ GstNuvDemux *nuv = GST_NUV_DEMUX (gst_pad_get_parent (sinkpad)); if (active) { + nuv->mode = 0; + if (nuv->adapter) { + gst_adapter_clear (nuv->adapter); + g_object_unref (nuv->adapter); + nuv->adapter = NULL; + } gst_pad_start_task (sinkpad, (GstTaskFunction) gst_nuv_demux_loop, sinkpad); } else { gst_pad_stop_task (sinkpad);