<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><!-- footer --><br> 
<hr>
<font style="font-size:12px;line-height:15px;">500强春季最新高薪职位信息,</font><a style="font-size:12px;line-height:15px; color:blue; text-decoration:underline;" href="http://popme.163.com/link/004199_0407_8566.html">快填简历参加面试</a>