GNOME Bugzilla – Bug 665731
Adding and removing layers to a timeline gets random crashes
Last modified: 2012-01-12 16:04:22 UTC
Created attachment 202991 [details] Test program To compile the program: gcc [ -DNO_RESET_LAYERS ] -o test -Wall -Werror `pkg-config --libs --cflags gst-editing-services-0.10` main.c The program just creates a timeline with a video layer and an audio layer with a different audio (to replace the original audio). If you run this program with the NO_RESET_LAYERS flags the program works perfectly, but if you remove the flag, the program is crashing about 50% of the times.
I think this only happens if you don't force the pipeline to preroll before removing and adding the layers again. I couldn't see the bug if you move the pipeline to PLAYING, then NULL and then remove and add the layers again.
Created attachment 204590 [details] [review] GESTimeline: Lock object discovery list Confirmed. This patch seems to fix it for me. Review welcome.
Created attachment 204682 [details] [review] Updated patch g_list_remove_all () can be used as a simplification as the private data to ges timeline object are 1:1.
commit e288a6f4604323518fae42591122228342d2c3da Author: Robert Swain <robert.swain@gmail.com> Date: Fri Jan 6 09:16:09 2012 -0300 timeline: simplify code to remove an object from the pendingobjects list g_list_remove_all () can be used as a simplification as the private data to ges timeline object are 1:1. commit fc97c16e7e43cd2362175106e72541113b5e4a81 Author: Robert Swain <robert.swain@gmail.com> Date: Wed Jan 4 17:24:16 2012 +0100 GESTimeline: Lock object discovery list TimelineFileSource objects are asynchronously discovered with discoverer with such objects being added to a pendingobjects list. If one were to remove a layer before an object in said layer had been discovered, a segfault could occur. As such, management of the list has been made more robust with the addition of a mutex and removal of the object from the pendingobjects list upon layer removal.
Thx!