diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2015-03-16 17:06:46 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2015-07-30 14:00:05 -0400 |
commit | 3f2bc1e4b2f893d4a93a108bd3738444620821f4 (patch) | |
tree | 2ecdbe42f3d47b8971395db209c7454fddbf2fcd /gst | |
parent | 6efc106a67ce6ba2a8313150ef919c0be9234da6 (diff) | |
download | gstreamer-plugins-bad-3f2bc1e4b2f893d4a93a108bd3738444620821f4.tar.gz |
audioaggregator: On timeout, resync pads with not enough data
https://bugzilla.gnome.org/show_bug.cgi?id=745768
Diffstat (limited to 'gst')
-rw-r--r-- | gst/audiomixer/gstaudioaggregator.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gst/audiomixer/gstaudioaggregator.c b/gst/audiomixer/gstaudioaggregator.c index 351b1d70a..ca06a6606 100644 --- a/gst/audiomixer/gstaudioaggregator.c +++ b/gst/audiomixer/gstaudioaggregator.c @@ -1271,6 +1271,20 @@ gst_audio_aggregator_aggregate (GstAggregator * agg, gboolean timeout) aagg->priv->offset = next_offset; agg->segment.position = next_timestamp; + /* If there was a timeout and there was a gap in data in out of the streams, + * then it's a very good time to for a resync with the timestamps. + */ + if (timeout) { + for (iter = element->sinkpads; iter; iter = iter->next) { + GstAudioAggregatorPad *pad = GST_AUDIO_AGGREGATOR_PAD (iter->data); + + GST_OBJECT_LOCK (pad); + if (pad->priv->output_offset < aagg->priv->offset) + pad->priv->output_offset = -1; + GST_OBJECT_UNLOCK (pad); + } + } + GST_OBJECT_UNLOCK (agg); /* send it out */ |