info: stop playback on unrealize

Prevent "BadDrawable" errors.
This commit is contained in:
Stefan Sauer 2010-10-28 01:41:07 +03:00
parent 520518b660
commit 5f689af851

View file

@ -61,6 +61,7 @@ public class MediaInfo.Info : VBox
drawing_area = new DrawingArea (); drawing_area = new DrawingArea ();
drawing_area.set_size_request (300, 150); drawing_area.set_size_request (300, 150);
drawing_area.realize.connect (on_drawing_area_realize); drawing_area.realize.connect (on_drawing_area_realize);
drawing_area.unrealize.connect (on_drawing_area_unrealize);
pack_start (drawing_area, true, true, 0); pack_start (drawing_area, true, true, 0);
table = new Table (7, 2, false); table = new Table (7, 2, false);
@ -216,6 +217,11 @@ public class MediaInfo.Info : VBox
widget.unset_flags(Gtk.WidgetFlags.DOUBLE_BUFFERED); widget.unset_flags(Gtk.WidgetFlags.DOUBLE_BUFFERED);
} }
private void on_drawing_area_unrealize (Widget widget)
{
pb.set_state (State.NULL);
}
private void on_element_sync_message (Gst.Bus bus, Message message) private void on_element_sync_message (Gst.Bus bus, Message message)
{ {
Structure structure = message.get_structure (); Structure structure = message.get_structure ();