chuannguyen / gladstone

Automatically exported from code.google.com/p/gladstone
Other
0 stars 0 forks source link

Timestamps are wrong #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Running a simple :
gst-launch pulsesrc ! g729enc ! g729dec ! pulsesink
or
gst-launch audiotestsrc is-live=true ! g729enc ! g729dec ! pulsesink

What is the expected output? What do you see instead?
I expect sound to play, but it doesn't.. pulsesink also keeps complaining about 
underflows if we add GST_DEBUG=3, and identity complains if we add 'identity 
check-perfect=true' to the pipeline after the encoder or decoder.

What version of the product are you using? On what operating system?
latest svn, on linux debian

Please provide any additional information below.
The timestamps are not correct which causes all these issues.. the fact that 
you use an adapter helps since you can ask for prev_timestamp, but you should 
also use the distance to scale it. In some places, you also put '10' for 
duration instead of '10 * GST_MSECOND'.
Attached is a patch that fixes all of that... however, on top of the fixes, it 
also adds a small hack..
Although the timestamps are perfect, for some reason pulsesink thinks they're 
coming too early so it drops them.. if we use audiotestsrc and make it output a 
huge buffer, then the first few 10ms buffers will be dropped, then the rest 
will play (a bit early) then we get an underflow again and a small gap before 
the next buffers start playing... so I shifted the timestamps by 100ms, it 
seems to fix the problem, although I'm not sure why it fixes it, since the 
encoder seems to correctly report its latency... 

Original issue reported on code.google.com by snifikino on 24 Sep 2010 at 5:46

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you for the patch! It looks a good improvement, so I've applied it.

Original comment by gibrova...@gmail.com on 26 Sep 2010 at 6:05

GoogleCodeExporter commented 8 years ago
Thanks :)

Original comment by snifikino on 27 Sep 2010 at 8:52