From c158e019c18fdf51c821aae5348a00ae0dbb1bc6 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 21 Jul 2014 11:07:19 +0200 Subject: [PATCH] audiomixer: Set the sinkpad segments basetime after seeking Otherwise stream offset and running time comparison will not be correct, leading to segfaults after seeks --- gst/audiomixer/gstaudiomixer.c | 3 +++ gst/audiomixer/gstaudiomixer.h | 1 + 2 files changed, 4 insertions(+) diff --git a/gst/audiomixer/gstaudiomixer.c b/gst/audiomixer/gstaudiomixer.c index d95b91e0f1..ef0b21c904 100644 --- a/gst/audiomixer/gstaudiomixer.c +++ b/gst/audiomixer/gstaudiomixer.c @@ -706,6 +706,8 @@ gst_audiomixer_src_event (GstAggregator * agg, GstEvent * event) /* Link up */ result = GST_AGGREGATOR_CLASS (parent_class)->src_event (agg, event); + if (result) + audiomixer->base_time = agg->segment.start; goto done; } break; @@ -1131,6 +1133,7 @@ gst_audio_mixer_fill_buffer (GstAudioMixer * audiomixer, GstAudioMixerPad * pad, guint64 start_running_time_offset; guint64 end_running_time_offset; + aggpad->segment.base = audiomixer->base_time; start_running_time = gst_segment_to_running_time (&aggpad->segment, GST_FORMAT_TIME, start_time); diff --git a/gst/audiomixer/gstaudiomixer.h b/gst/audiomixer/gstaudiomixer.h index 6433ea1a4c..f5db18ffeb 100644 --- a/gst/audiomixer/gstaudiomixer.h +++ b/gst/audiomixer/gstaudiomixer.h @@ -71,6 +71,7 @@ struct _GstAudioMixer { /* Last time we noticed a discont */ GstClockTime discont_time; + gint64 base_time; /* Size in samples that is output per buffer */ guint blocksize;