After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 791347 - interaudio: Fix undefined DTS
interaudio: Fix undefined DTS
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-12-07 15:18 UTC by Carlos Rafael Giani
Modified: 2018-02-11 20:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
interaudiosrc DTS patch (1.38 KB, patch)
2017-12-07 15:19 UTC, Carlos Rafael Giani
committed Details | Review

Description Carlos Rafael Giani 2017-12-07 15:18:00 UTC
Currently, interaudiosrc does not set the DTS value, only the PTS one. This can cause basesrc to produce incorrect buffer timestamps.

This is because basesrc performs this check:
    
  if (GST_CLOCK_TIME_IS_VALID (dts))
    timestamp = dts;
  else
    timestamp = pts;

So, if the undefined DTS value happens to be anything other than ((guint64)-1),
basesrc ends up using the undefined DTS value instead of the defined PTS one for
the outgoing buffers.

Fix this by explicitely setting DTS to GST_CLOCK_TIME_NONE.
Comment 1 Carlos Rafael Giani 2017-12-07 15:19:23 UTC
Created attachment 365199 [details] [review]
interaudiosrc DTS patch
Comment 2 Nicolas Dufresne (ndufresne) 2017-12-07 15:55:46 UTC
Review of attachment 365199 [details] [review]:

Interesting, I have always assumed the PTS/DTS were initialized to that automatically, that raises a lot of questions.
Comment 3 Tim-Philipp Müller 2018-02-11 20:50:31 UTC
Don't see any reason not to push this, just wondering how this might happen in the first place. Does this dts come from the pipeline upstream of interaudiosink? Or does GstAdapter mess up?

commit ec963e688f205408db4000efba97ab7c0262059d
Author: Carlos Rafael Giani <dv@pseudoterminal.org>
Date:   Thu Dec 7 15:52:39 2017 +0100

    interaudio: Make sure both PTS and DTS values are defined
    
    The inter plugin originated in 0.10, which had only one timestamp. As a
    result, during the port to 1.0, the DTS were left undefined. This can cause
    subtle bugs with basesrc, which can end up incorrectly picking DTS over PTS
    and producing output buffers with incorrect timestamps.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791347