GNOME Bugzilla – Bug 786275
adaptivedemux: busy loop when manifest changes liveness
Last modified: 2017-08-15 05:25:26 UTC
The scenario is, a manifest starts out in live mode but then the recording is finalized and a subsequent update changes the state to a non-live manifest when the server has finished recording/transcoding/whatever with the full list of fragments. At this changeover, the manifest update task in adaptivedemux will busy loop.
Created attachment 357546 [details] [review] adaptivedemux: start/stop the manifest update loop on liveness or periodic update changes
Review of attachment 357546 [details] [review]: ::: gst-libs/gst/adaptivedemux/gstadaptivedemux.c @@ +4356,3 @@ + gst_adaptive_demux_stop_manifest_update_task (demux); + } + gst_adaptive_demux_start_manifest_update_task (demux); Shouldn't this be in an else case? You now stop the task and always start it again?
(In reply to Sebastian Dröge (slomo) from comment #2) > Review of attachment 357546 [details] [review] [review]: > > ::: gst-libs/gst/adaptivedemux/gstadaptivedemux.c > @@ +4356,3 @@ > + gst_adaptive_demux_stop_manifest_update_task (demux); > + } > + gst_adaptive_demux_start_manifest_update_task (demux); > > Shouldn't this be in an else case? You now stop the task and always start it > again? start has the exact opposite conditions as the above stop internally in the function.
Comment on attachment 357546 [details] [review] adaptivedemux: start/stop the manifest update loop on liveness or periodic update changes Maybe add a comment then, it's confusing. But good to go otherwise
I verified that the patch does fix the high CPU usage on my system as well.
commit cbf4a44426ca98df8337768ed7bb8a87b5c169a3 Author: Matthew Waters <matthew@centricular.com> Date: Mon Aug 14 21:33:51 2017 +1000 adaptivedemux: start/stop the manifest update loop on liveness or periodic update changes Scenario: A manifest starts out in live mode but then the recording is finalized and a subsequent update changes the state to a non-live manifest when the server has finished recording/transcoding/whatever with the full list of fragments. Without this patch, the manifest update task is never stopped on the live->non-live transition and will busy loop, burning through one CPU core. https://bugzilla.gnome.org/show_bug.cgi?id=786275