GNOME Bugzilla – Bug 736919
hlsdemux: attempt to unlock an already unlocked mutex in gst_hls_demux_change_playlist
Last modified: 2014-09-19 06:50:33 UTC
If we enter in the code below the retry_failover_protection label not triggered by a goto the demux->client mutex is unlocked and an attempt to unlock it is made after the current_variant update.
Happens with the now famous bipbop demo: https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/bipbop_4x3_variant.m3u8
Created attachment 286518 [details] [review] patch
Thanks, pushed: commit 6d67b5263f505a8d23b2d4b92f05384baead4a22 Author: Philippe Normand <philn@igalia.com> Date: Thu Sep 18 18:16:59 2014 +0200 hlsdemux: lock client mutex before entering the retry_failover block This is consistent with the case where the block execution is triggered by the goto invoked after the current_variant update. https://bugzilla.gnome.org/show_bug.cgi?id=736919
The patch fixes the issue for me, but on second thought, shouldn't the lock be taken a bit earlier, before previous_variant = demux->client->main->current_variant; ?
Hum that would be better yes but then the lock needs to be released again just before the call to gst_m3u8_client_get_playlist_for_bitrate() to prevent a deadlock.
While this is true, I backported it to 1.4 for 1.4.2 already as it fixes a real problem for now. That locking has to be reconsidered though :)