summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@igalia.com>2021-09-01 17:26:04 -0400
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-09-03 15:56:31 +0000
commitf7cbbb5d9a1ff67f94477d8a7f7d4357416ea2e3 (patch)
treef46bfdde026610375f1ca45b1a233b35e013e21d /ext
parent0531eebf514a0adbbadbf9e27c1fbdf5eccf06e7 (diff)
downloadgstreamer-plugins-bad-f7cbbb5d9a1ff67f94477d8a7f7d4357416ea2e3.tar.gz
wpe: Use the new element.get_current_running_time API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2504>
Diffstat (limited to 'ext')
-rw-r--r--ext/wpe/gstwpesrcbin.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/ext/wpe/gstwpesrcbin.cpp b/ext/wpe/gstwpesrcbin.cpp
index 78afbaf4b..22150d26f 100644
--- a/ext/wpe/gstwpesrcbin.cpp
+++ b/ext/wpe/gstwpesrcbin.cpp
@@ -269,7 +269,6 @@ gst_wpe_src_push_audio_buffer (GstWpeSrc* src, guint32 id, guint64 size)
{
GstWpeAudioPad *audio_pad = GST_WPE_AUDIO_PAD (g_hash_table_lookup (src->audio_src_pads, GUINT_TO_POINTER (id)));
GstBuffer *buffer;
- GstClock *clock;
g_return_if_fail (audio_pad->fd > 0);
@@ -280,21 +279,9 @@ gst_wpe_src_push_audio_buffer (GstWpeSrc* src, guint32 id, guint64 size)
munmap (data, size);
gst_buffer_add_audio_meta (buffer, &audio_pad->info, size, NULL);
- clock = gst_element_get_clock (GST_ELEMENT_CAST (src));
- if (clock) {
- GstClockTime now;
- GstClockTime base_time = gst_element_get_base_time (GST_ELEMENT_CAST (src));
-
- now = gst_clock_get_time (clock);
- if (now > base_time)
- now -= base_time;
- else
- now = 0;
- gst_object_unref (clock);
-
- audio_pad->buffer_time = now;
- GST_BUFFER_DTS (buffer) = audio_pad->buffer_time;
- }
+ audio_pad->buffer_time = gst_element_get_current_running_time (GST_ELEMENT (src));
+ GST_BUFFER_DTS (buffer) = audio_pad->buffer_time;
+ GST_BUFFER_PTS (buffer) = audio_pad->buffer_time;
GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_DISCONT);
if (audio_pad->discont_pending) {