playbin: Drop reference to any source element in NULL state
authorJan Schmidt <jan@centricular.com>
Thu, 3 Apr 2014 15:14:50 +0000 (02:14 +1100)
committerJan Schmidt <jan@centricular.com>
Thu, 3 Apr 2014 15:15:53 +0000 (02:15 +1100)
Drop the reference instead of waiting for either finalize(), or
for a new source when reused. Everyone else already forgot about
the old source.

gst/playback/gstplaybin2.c

index 5e1ee7e..89bb951 100644 (file)
@@ -5547,6 +5547,12 @@ gst_play_bin_change_state (GstElement * element, GstStateChange transition)
           l = l->next;
         }
       }
+
+      if (playbin->source) {
+        gst_object_unref (playbin->source);
+        playbin->source = NULL;
+      }
+
       GST_OBJECT_UNLOCK (playbin);
       break;
     }