mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-09 05:38:58 +00:00
flacdec: fix possible hanging in pull mode seeking
A seek in multi-sink pipeline typically leads to several seek events in a row, which could lead to sending several newsegments in a row without intermediate flushing. These would then accumulate, distort rendering times and as such lead to 'hanging'.
This commit is contained in:
parent
05307c46e7
commit
d6633d6edc
1 changed files with 10 additions and 0 deletions
|
@ -1773,6 +1773,16 @@ gst_flac_dec_handle_seek_event (GstFlacDec * flacdec, GstEvent * event)
|
|||
* downstream in PAUSED, for example */
|
||||
GST_PAD_STREAM_LOCK (flacdec->sinkpad);
|
||||
|
||||
/* start seek with clear state to avoid seeking thread pushing segments/data.
|
||||
* Note current state may have some pending,
|
||||
* e.g. multi-sink seek leads to immediate subsequent seek events */
|
||||
if (flacdec->start_segment) {
|
||||
gst_event_unref (flacdec->start_segment);
|
||||
flacdec->start_segment = NULL;
|
||||
}
|
||||
gst_buffer_replace (&flacdec->pending, NULL);
|
||||
flacdec->pending_samples = 0;
|
||||
|
||||
/* save a segment copy until we know the seek worked. The idea is that
|
||||
* when the seek fails, we want to restore with what we were doing. */
|
||||
segment = flacdec->segment;
|
||||
|
|
Loading…
Reference in a new issue