<DIV>Hi sudarshan ,</DIV>
<DIV>&nbsp;&nbsp;&nbsp; It have simply processed the state changes. namely when&nbsp; the change is ST_STATE_CHANGE_READY_TO_NULL, reset the decode and clear the buffers,</DIV>
<DIV>and I am tring to change to pipeline's scheduling mode according to Tyler's suggestion. anyhow,thank you a lot!</DIV>
<DIV>&nbsp;&nbsp; Volter</DIV>
<DIV>&nbsp;</DIV><BR>在2008-04-09,"sudarshan bisht" &lt;bisht.sudarshan@gmail.com&gt; 写道:<BR>
<BLOCKQUOTE id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<DIV>Hi Volter,</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Its better to implement all the event handling in _change_state function . <BR><BR></DIV>
<DIV class="gmail_quote">2008/4/8 Volter Yen &lt;<A href="mailto:volter619@163.com">volter619@163.com</A>&gt;:<BR>
<BLOCKQUOTE class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<DIV>Hi all,</DIV>
<DIV>&nbsp;&nbsp;&nbsp; Recently,I used the adecode to try to implement an&nbsp;audio player with &nbsp;fast forward/backwad fuctions, but It gave no response to my seeking action in my application, and the probelm maybe be caused by the event process in the decode element,it just forward the event to other elements in the pipe. </DIV>
<DIV>&nbsp;and&nbsp; the related codes are&nbsp;as follow:&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color="#808080">static gboolean gst_adecoder_src_event(GstPad * pad, GstEvent * event)<BR>{<BR>&nbsp;&nbsp;&nbsp; gboolean res;</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; GstADecoder *adecoder;</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; adecoder = GST_ADECODER(GST_PAD_PARENT(pad));</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; if (adecoder-&gt;codec_handle == NULL)</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; goto no_decoder;</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; res = gst_pad_push_event(adecoder-&gt;sinkpad, event);</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; return res;</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; no_decoder:<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GST_DEBUG_OBJECT(adecoder, "no decoder, cannot handle event");</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_event_unref(event);</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return FALSE;<BR>&nbsp;&nbsp;&nbsp; }<BR>}</FONT></DIV>
<DIV><FONT color="#808080"></FONT>&nbsp;</DIV>
<DIV><FONT color="#808080"></FONT>&nbsp;</DIV>
<DIV><FONT color="#808080">static gboolean gst_adecoder_sink_event(GstPad * pad, GstEvent * event)<BR>{</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; GstADecoder *adecoder = GST_ADECODER(GST_PAD_PARENT(pad));</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; gboolean ret = TRUE;</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; #ifdef DEBUG</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; printf("Got %s event on sink pad\n", GST_EVENT_TYPE_NAME(event));</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; #endif</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; switch (GST_EVENT_TYPE(event))<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;case GST_EVENT_NEWSEGMENT:</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;ret = gst_pad_event_default(pad, event);</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;break;</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; &nbsp;case GST_EVENT_FLUSH_START:</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret = gst_pad_event_default(pad, event);</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; &nbsp;case GST_EVENT_FLUSH_STOP:</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret = gst_pad_event_default(pad, event);</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; &nbsp;case GST_EVENT_EOS:</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_adecoder_decode_remaining(adecoder);</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#808080">ret = gst_pad_event_default(pad, event);</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; &nbsp;default:</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret = gst_pad_event_default(pad, event);</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; return ret;<BR>}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Is there any problem? Any suggestion? Thank you!</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Volter</DIV><BR><BR>
<HR>
<FONT style="FONT-SIZE: 12px; LINE-HEIGHT: 15px">500强春季最新高薪职位信息,</FONT><A style="FONT-SIZE: 12px; COLOR: blue; LINE-HEIGHT: 15px; TEXT-DECORATION: underline" href="http://popme.163.com/link/004199_0407_8566.html" target="_blank">快填简历参加面试</A><BR>-------------------------------------------------------------------------<BR>This SF.net email is sponsored by the 2008 JavaOne(SM) Conference<BR>Register now and save $200. Hurry, offer ends at 11:59 p.m.,<BR>Monday, April 7! Use priority code J8TLD2.<BR><A href="http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone" target="_blank">http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone</A><BR>_______________________________________________<BR>gstreamer-devel mailing list<BR><A href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</A><BR><A href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</A><BR><BR></BLOCKQUOTE></DIV><BR><BR clear="all"><BR>-- <BR>Regards,<BR><BR>Sudarshan Bisht </BLOCKQUOTE><br><!-- footer --><br> 
<hr>
<font style="font-size:12px;line-height:15px;">蒙牛以领先责任创4年至高荣誉 </font><a style="font-size:12px;line-height:15px; color:blue; text-decoration:underline;" href="http://popme.163.com/link/004228_0408_3476.html">权威数据为蒙牛加冕</a>