gst/adder/gstadder.c: Fix non-flushing segmented seeks, Fixes #340060 for me

Original commit message from CVS:
* gst/adder/gstadder.c: (gst_adder_setcaps), (gst_adder_src_event),
(gst_adder_sink_event), (gst_adder_collected):
Fix non-flushing segmented seeks, Fixes #340060 for me
This commit is contained in:
Stefan Kost 2007-04-23 20:04:28 +00:00
parent 478fd77793
commit d24aff28b2
3 changed files with 29 additions and 21 deletions

View file

@ -1,3 +1,9 @@
2007-04-23 Stefan Kost <ensonic@users.sf.net>
* gst/adder/gstadder.c: (gst_adder_setcaps), (gst_adder_src_event),
(gst_adder_sink_event), (gst_adder_collected):
Fix non-flushing segmented seeks, Fixes #340060 for me
2007-04-21 Tim-Philipp Müller <tim at centricular dot net> 2007-04-21 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Olivier Crete <tester at tester ca> Patch by: Olivier Crete <tester at tester ca>

2
common

@ -1 +1 @@
Subproject commit 765d03a88492fb4ac81d70457f671f3a109e93de Subproject commit a19d235c89d99ca7849078d501129f521e30d98d

View file

@ -169,6 +169,9 @@ gst_adder_setcaps (GstPad * pad, GstCaps * caps)
adder = GST_ADDER (GST_PAD_PARENT (pad)); adder = GST_ADDER (GST_PAD_PARENT (pad));
GST_LOG_OBJECT (adder, "setting caps on pad %p,%s to %" GST_PTR_FORMAT, pad,
GST_PAD_NAME (pad), caps);
/* FIXME, see if the other pads can accept the format. Also lock the /* FIXME, see if the other pads can accept the format. Also lock the
* format on the other pads to this new format. */ * format on the other pads to this new format. */
GST_OBJECT_LOCK (adder); GST_OBJECT_LOCK (adder);
@ -442,16 +445,15 @@ gst_adder_src_event (GstPad * pad, GstEvent * event)
gst_event_parse_seek (event, NULL, NULL, &flags, &curtype, &cur, NULL, gst_event_parse_seek (event, NULL, NULL, &flags, &curtype, &cur, NULL,
NULL); NULL);
/* if we are not flushing, just forward */ /* check if we are flushing */
if (!flags & GST_SEEK_FLAG_FLUSH) if (flags & GST_SEEK_FLAG_FLUSH) {
goto done; /* make sure we accept nothing anymore and return WRONG_STATE */
gst_collect_pads_set_flushing (adder->collect, TRUE);
/* make sure we accept nothing anymore and return WRONG_STATE */ /* flushing seek, start flush downstream, the flush will be done
gst_collect_pads_set_flushing (adder->collect, TRUE); * when all pads received a FLUSH_STOP. */
gst_pad_push_event (adder->srcpad, gst_event_new_flush_start ());
/* flushing seek, start flush downstream, the flush will be done }
* when all pads received a FLUSH_STOP. */
gst_pad_push_event (adder->srcpad, gst_event_new_flush_start ());
/* now wait for the collected to be finished and mark a new /* now wait for the collected to be finished and mark a new
* segment */ * segment */
@ -463,7 +465,6 @@ gst_adder_src_event (GstPad * pad, GstEvent * event)
adder->segment_pending = TRUE; adder->segment_pending = TRUE;
GST_OBJECT_UNLOCK (adder->collect); GST_OBJECT_UNLOCK (adder->collect);
done:
result = forward_event (adder, event); result = forward_event (adder, event);
break; break;
} }
@ -670,16 +671,17 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data)
if (G_UNLIKELY (adder->func == NULL)) if (G_UNLIKELY (adder->func == NULL))
goto not_negotiated; goto not_negotiated;
outbuf = NULL;
outbytes = NULL;
/* get available bytes for reading, this can be 0 which could mean /* get available bytes for reading, this can be 0 which could mean
* empty buffers or EOS, which we will catch when we loop over the * empty buffers or EOS, which we will catch when we loop over the
* pads. */ * pads. */
size = gst_collect_pads_available (pads); size = gst_collect_pads_available (pads);
GST_LOG_OBJECT (adder, GST_LOG_OBJECT (adder,
"starting to cycle through channels, %d bytes available", size); "starting to cycle through channels, %d bytes available (bps = %d)", size,
adder->bps);
outbuf = NULL;
outbytes = NULL;
for (collected = pads->data; collected; collected = g_slist_next (collected)) { for (collected = pads->data; collected; collected = g_slist_next (collected)) {
GstCollectData *data; GstCollectData *data;