threadshare: fix latency query handlers

Returning 0 as the max latency in those sources is incorrect,
and may lead to sinks incorrectly complaining about insufficient
buffering elements.

Reproduce with:

gst-launch-1.0 ts-udpsrc port=50000 address=127.0.0.1 \
  caps="application/x-rtp, media=(string)audio, clock-rate=(int)8000, encoding-name=(string)PCMA, payload=(int)8" ! \
  rtppcmadepay ! alawdec ! autoaudiosink

gst-launch-1.0 audiotestsrc do-timestamp=true samplesperbuffer=400 ! \
  alawenc ! rtppcmapay max-ptime=50000000 min-ptime=50000000 ! \
  udpsink host=127.0.0.1 port=50000

Logs:

Not enough buffering available for  the processing deadline of 0:00:00.020000000,
add enough queues to buffer  0:00:00.020000000 additional data.
Shortening processing latency to 0:00:00.000000000.

This then causes glitches, there are many other ways for the problems
to manifest.
This commit is contained in:
Mathieu Duponchelle 2020-01-23 16:09:40 +01:00 committed by Mathieu Duponchelle
parent decc1e2029
commit c50aa09034
4 changed files with 4 additions and 4 deletions

View file

@ -363,7 +363,7 @@ impl PadSrcHandler for AppSrcPadHandler {
gst_log!(CAT, obj: pad.gst_pad(), "Handling {:?}", query);
let ret = match query.view_mut() {
QueryView::Latency(ref mut q) => {
q.set(true, 0.into(), 0.into());
q.set(true, 0.into(), gst::CLOCK_TIME_NONE);
true
}
QueryView::Scheduling(ref mut q) => {

View file

@ -1101,7 +1101,7 @@ impl PadSrcHandler for ProxySrcPadHandler {
gst_log!(SRC_CAT, obj: pad.gst_pad(), "Handling {:?}", query);
let ret = match query.view_mut() {
QueryView::Latency(ref mut q) => {
q.set(true, 0.into(), 0.into());
q.set(true, 0.into(), gst::CLOCK_TIME_NONE);
true
}
QueryView::Scheduling(ref mut q) => {

View file

@ -423,7 +423,7 @@ impl PadSrcHandler for TcpClientSrcPadHandler {
gst_log!(CAT, obj: pad.gst_pad(), "Handling {:?}", query);
let ret = match query.view_mut() {
QueryView::Latency(ref mut q) => {
q.set(false, 0.into(), 0.into());
q.set(false, 0.into(), gst::CLOCK_TIME_NONE);
true
}
QueryView::Scheduling(ref mut q) => {

View file

@ -590,7 +590,7 @@ impl PadSrcHandler for UdpSrcPadHandler {
let ret = match query.view_mut() {
QueryView::Latency(ref mut q) => {
q.set(true, 0.into(), 0.into());
q.set(true, 0.into(), gst::CLOCK_TIME_NONE);
true
}
QueryView::Scheduling(ref mut q) => {