gst/gstbin.c: Fix for #321595

Original commit message from CVS:
* gst/gstbin.c: (gst_bin_change_state_func):
Fix for #321595
This commit is contained in:
Wim Taymans 2005-11-21 19:13:13 +00:00
parent 1cbf6f7027
commit 5252cefbed
2 changed files with 22 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2005-11-21 Wim Taymans <wim@fluendo.com>
* gst/gstbin.c: (gst_bin_change_state_func):
Fix for #321595
2005-11-21 Wim Taymans <wim@fluendo.com>
* gst/gstsegment.h:

View file

@ -1643,12 +1643,23 @@ gst_bin_change_state_func (GstElement * element, GstStateChange transition)
bin = GST_BIN_CAST (element);
/* Clear message list on next PAUSED */
if (next == GST_STATE_PAUSED) {
GST_OBJECT_LOCK (bin);
GST_DEBUG_OBJECT (element, "clearing EOS elements");
bin_remove_messages (bin, NULL, GST_MESSAGE_EOS);
GST_OBJECT_UNLOCK (bin);
switch (next) {
case GST_STATE_PAUSED:
/* Clear EOS list on next PAUSED */
GST_OBJECT_LOCK (bin);
GST_DEBUG_OBJECT (element, "clearing EOS elements");
bin_remove_messages (bin, NULL, GST_MESSAGE_EOS);
GST_OBJECT_UNLOCK (bin);
break;
case GST_STATE_READY:
/* Clear message list on next READY */
GST_OBJECT_LOCK (bin);
GST_DEBUG_OBJECT (element, "clearing all cached messages");
bin_remove_messages (bin, NULL, GST_MESSAGE_ANY);
GST_OBJECT_UNLOCK (bin);
break;
default:
break;
}
/* iterate in state change order */