mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
gst/playback/gstdecodebin2.c: Ensure decodebin2 emits 'drained' signal once, and only once, when all pads are drained.
Original commit message from CVS: * gst/playback/gstdecodebin2.c: Ensure decodebin2 emits 'drained' signal once, and only once, when all pads are drained.
This commit is contained in:
parent
bcc3b3b5f5
commit
9d2564874a
2 changed files with 17 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
2008-06-20 Michael Smith <msmith@songbirdnest.com>
|
||||
|
||||
* gst/playback/gstdecodebin2.c:
|
||||
Ensure decodebin2 emits 'drained' signal once, and only once, when all
|
||||
pads are drained.
|
||||
|
||||
2008-06-20 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||
|
||||
* ext/vorbis/vorbisenc.c: (gst_vorbis_enc_get_latency),
|
||||
|
|
|
@ -1836,6 +1836,14 @@ gst_decode_group_check_if_drained (GstDecodeGroup * group)
|
|||
|
||||
GST_LOG ("group : %p", group);
|
||||
|
||||
DECODE_BIN_LOCK (dbin);
|
||||
|
||||
/* Ensure we only emit the drained signal once, for this group */
|
||||
if (group->drained) {
|
||||
drained = FALSE;
|
||||
goto done;
|
||||
}
|
||||
|
||||
for (tmp = group->endpads; tmp; tmp = g_list_next (tmp)) {
|
||||
GstDecodePad *dpad = (GstDecodePad *) tmp->data;
|
||||
|
||||
|
@ -1849,10 +1857,9 @@ gst_decode_group_check_if_drained (GstDecodeGroup * group)
|
|||
|
||||
group->drained = drained;
|
||||
if (!drained)
|
||||
return;
|
||||
goto done;
|
||||
|
||||
/* we are drained. Check if there is a next group to activate */
|
||||
DECODE_BIN_LOCK (dbin);
|
||||
if ((group == dbin->activegroup) && dbin->groups) {
|
||||
GST_DEBUG_OBJECT (dbin, "Switching to new group");
|
||||
|
||||
|
@ -1863,6 +1870,8 @@ gst_decode_group_check_if_drained (GstDecodeGroup * group)
|
|||
/* we're not yet drained now */
|
||||
drained = FALSE;
|
||||
}
|
||||
|
||||
done:
|
||||
DECODE_BIN_UNLOCK (dbin);
|
||||
|
||||
if (drained) {
|
||||
|
|
Loading…
Reference in a new issue