[gst-devel] Re: Re: mp3dec seek problem
zhangfei gao
gaozhangfei at yahoo.com.cn
Mon Mar 5 07:19:13 CET 2007
Hello, Pankaj
Thanks so much for your valuable information.
I find the test application cause the phenonmen.
if I use following two functions, it will block, and need resyncing, still,
pluging receive newsegment event twice, first update=1, second update=0.
gst_element_seek_simple(pipe,fmt,GST_SEEK_TYPE_SET,time)
gst_element_seek (pipe,
1.0, GST_FORMAT_TIME,
0, //GST_SEEK_FLAG_FLUSH,
GST_SEEK_TYPE_SET, time,
GST_SEEK_TYPE_NONE, -1)
but if I open flush flag, it will play continuously,
gst_element_seek (pipe,
1.0, GST_FORMAT_TIME,
GST_SEEK_FLAG_FLUSH,
GST_SEEK_TYPE_SET, time,
GST_SEEK_TYPE_NONE, -1)
now it will receive three events, first is flush-start, second is flush-stop,
last is newsegment, and the problem disappears, no resyncing is needed.
Still I have two confusion.
1, since we should find sync code after seeking, there will an offset, do we need resend newsegment in the chain once offset occur.
2, sometimes we do not know whether file support seek or not, for example, h264 files should have IDR frame to support seek, so we have to parse stream, while srcpad_event do not have income streams, which will occur in chain function. then is there any method to parse stream first then tell application whether support seek or not.
Thanks
Pankaj Sen <pankaj.sen77 at gmail.com> 写道:
Hi gao,
Can you tell me is the mp3dec is written by you using some library or you are just using it. It seems to me that there is some time stamp problem. You need to pass new segment event before sending the first output buffer, also set the caps and calculate proper time stamp. It you have written this plugin then if you can show me the chain function. I have written my own mp3dec plugin and also alsasink plugin. So, I may try to help you.
Regards,
Pankaj
On 3/1/07, zhangfei gao <gaozhangfei at yahoo.com.cn> wrote: hi,
I want to support seek in mp3dec, testing like this
gst-launch filesrc location=xx.mp3 ! mp3dec ! alsasink
But frequently after seeking, audio will blocking about 1~5 seconds, at the same time, print following message
WARNING: Element "alsasink0" warns: gstbaseaudiosink.c(696): gst_base_audio_sink_render (): /pipeline0/alsasink0:
Unexpected discontinuity in audio timestamps of more than half a second (0:00:11.394603174 ), resyncing
In sinkpad_event, I use "gst_event_new_new_segment" with new timestamp, which is calculated by new seek offset.
In chain function I use new timestamp as new start point.
Still I find alsasink seems omit the timestamp.
In gstbaseaudiosink.c gst_base_audio_sink_event function,
/* we only need the rate */
gst_event_parse_new_segment_full (event, NULL, &rate, NULL, NULL,
NULL, NULL, NULL);
how to solve the blocking issue, is there any tricky?
Thanks in advance!
---------------------------------
抢注雅虎免费邮箱-3.5G容量,20M附件!
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
---------------------------------
抢注雅虎免费邮箱-3.5G容量,20M附件!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20070305/41036dfe/attachment.htm>
More information about the gstreamer-devel
mailing list