From 5230b2354f8860097e9d8fc3e131be829a1452a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 12 Feb 2015 11:26:44 +0000 Subject: [PATCH] audiomixer: calculate stream_time used to sync pad values correctly Use pad (input) segment to calculate the stream time from the input timestamp, not the aggregator (output) segment. --- gst/audiomixer/gstaudiomixer.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gst/audiomixer/gstaudiomixer.c b/gst/audiomixer/gstaudiomixer.c index a58ef74..f48e268 100644 --- a/gst/audiomixer/gstaudiomixer.c +++ b/gst/audiomixer/gstaudiomixer.c @@ -973,22 +973,20 @@ static gboolean gst_audio_mixer_fill_buffer (GstAudioMixer * audiomixer, GstAudioMixerPad * pad, GstBuffer * inbuf) { + GstAggregatorPad *aggpad = GST_AGGREGATOR_PAD (pad); GstClockTime start_time, end_time; gboolean discont = FALSE; guint64 start_offset, end_offset; GstClockTime timestamp, stream_time; gint rate, bpf; - GstAggregator *agg = GST_AGGREGATOR (audiomixer); - GstAggregatorPad *aggpad = GST_AGGREGATOR_PAD (pad); - g_assert (pad->buffer == NULL); rate = GST_AUDIO_INFO_RATE (&audiomixer->info); bpf = GST_AUDIO_INFO_BPF (&audiomixer->info); timestamp = GST_BUFFER_TIMESTAMP (inbuf); - stream_time = gst_segment_to_stream_time (&agg->segment, GST_FORMAT_TIME, + stream_time = gst_segment_to_stream_time (&aggpad->segment, GST_FORMAT_TIME, timestamp); /* sync object properties on stream time */ -- 2.7.4