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.
This commit is contained in:
Tim-Philipp Müller 2015-02-12 11:26:44 +00:00
parent 3c9ae895b0
commit 195e54e06a

View file

@ -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 */