interaudio: Make sure both PTS and DTS values are defined
authorCarlos Rafael Giani <dv@pseudoterminal.org>
Thu, 7 Dec 2017 14:52:39 +0000 (15:52 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sun, 11 Feb 2018 20:41:14 +0000 (20:41 +0000)
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

gst/inter/gstinteraudiosrc.c

index 886632e..8a15f07 100644 (file)
@@ -412,7 +412,8 @@ gst_inter_audio_src_create (GstBaseSrc * src, guint64 offset, guint size,
 
   GST_BUFFER_OFFSET (buffer) = interaudiosrc->n_samples;
   GST_BUFFER_OFFSET_END (buffer) = interaudiosrc->n_samples + n;
-  GST_BUFFER_TIMESTAMP (buffer) = interaudiosrc->timestamp_offset +
+  GST_BUFFER_DTS (buffer) = GST_CLOCK_TIME_NONE;
+  GST_BUFFER_PTS (buffer) = interaudiosrc->timestamp_offset +
       gst_util_uint64_scale (interaudiosrc->n_samples, GST_SECOND,
       interaudiosrc->info.rate);
   GST_DEBUG_OBJECT (interaudiosrc, "create ts %" GST_TIME_FORMAT,