From: Georg Lippitsch Date: Mon, 26 Feb 2018 13:25:40 +0000 (+0100) Subject: alsasrc: Don't use driver timestamp if it's zero X-Git-Tag: 1.19.3~511^2~1081 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ed33011502cc617f0cd3b33f796c58faab39e93e;p=platform%2Fupstream%2Fgstreamer.git alsasrc: Don't use driver timestamp if it's zero Some alsa interfaces don't provide timestamps and thus always set the timestamp to zero. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/453 --- diff --git a/ext/alsa/gstalsasrc.c b/ext/alsa/gstalsasrc.c index 5fdf2dd..c6a7b57 100644 --- a/ext/alsa/gstalsasrc.c +++ b/ext/alsa/gstalsasrc.c @@ -947,6 +947,10 @@ gst_alsasrc_get_timestamp (GstAlsaSrc * asrc) /* get high resolution time stamp from driver */ snd_pcm_status_get_htstamp (status, &tstamp); + + if (tstamp.tv_sec == 0 && tstamp.tv_nsec == 0) + return GST_CLOCK_TIME_NONE; + timestamp = GST_TIMESPEC_TO_TIME (tstamp); /* max available frames sets the depth of the buffer */