Commit 9d256487 authored by Michael Smith's avatar Michael Smith
Browse files

gst/playback/gstdecodebin2.c: Ensure decodebin2 emits 'drained' signal once,...

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.
parent bcc3b3b5
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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment