summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Smith <msmith@xiph.org>2008-06-20 16:56:18 +0000
committerMichael Smith <msmith@xiph.org>2008-06-20 16:56:18 +0000
commit9d2564874a5bf4b47c80dbf086f52644afb83ffd (patch)
treeb91942093f97a6c68f24f9cfbcea5e89d8d1674a
parentbcc3b3b5f58705f88872eb5233cbed683504e44a (diff)
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.
-rw-r--r--ChangeLog6
-rw-r--r--gst/playback/gstdecodebin2.c13
2 files changed, 17 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1b29efba..84b46363 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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),
diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c
index 963f69ce..4f8ebdba 100644
--- a/gst/playback/gstdecodebin2.c
+++ b/gst/playback/gstdecodebin2.c
@@ -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) {