audiomixer: Set the sinkpad segments basetime after seeking
authorThibault Saunier <tsaunier@gnome.org>
Mon, 21 Jul 2014 09:07:19 +0000 (11:07 +0200)
committerThibault Saunier <tsaunier@gnome.org>
Mon, 6 Oct 2014 16:57:28 +0000 (18:57 +0200)
Otherwise stream offset and running time comparison will not be
correct, leading to segfaults after seeks

gst/audiomixer/gstaudiomixer.c
gst/audiomixer/gstaudiomixer.h

index d95b91e..ef0b21c 100644 (file)
@@ -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);
index 6433ea1..f5db18f 100644 (file)
@@ -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;