From 387e5f0c142fcbd3338fb86d97443b3671afc538 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Mon, 2 Dec 2013 20:35:04 +0100 Subject: [PATCH] audiodecoder: use segment start as fallback ts if no other available Fixes https://bugzilla.gnome.org/show_bug.cgi?id=709965 --- gst-libs/gst/audio/gstaudiodecoder.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c index 12df4850c..51b0dcf0d 100644 --- a/gst-libs/gst/audio/gstaudiodecoder.c +++ b/gst-libs/gst/audio/gstaudiodecoder.c @@ -1101,6 +1101,11 @@ gst_audio_decoder_finish_frame (GstAudioDecoder * dec, GstBuffer * buf, GST_DEBUG_OBJECT (dec, "base_ts now %" GST_TIME_FORMAT, GST_TIME_ARGS (ts)); } + /* still no valid ts, track the segment one */ + if (G_UNLIKELY (!GST_CLOCK_TIME_IS_VALID (priv->base_ts))) { + priv->base_ts = dec->output_segment.start; + } + /* slightly convoluted approach caters for perfect ts if subclass desires */ if (GST_CLOCK_TIME_IS_VALID (ts)) { if (dec->priv->tolerance > 0) { -- 2.34.1