Skip to content

Commit

Permalink
Limited to 1 the duration-discovery threads number
Browse files Browse the repository at this point in the history
This should fix an occasional deadlock (apparently on the GIL) when creating media-cues the first time.
Unfortunately this slows a bit the process of retrieving files duration.
  • Loading branch information
FrancescoCeruti committed May 22, 2016
1 parent 4b0fc93 commit cb45a8c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lisp/backends/gst/gst_media.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import weakref
from concurrent.futures import ThreadPoolExecutor
from os import path, cpu_count as _cpu_count
from os import path

from lisp.backends.base.media import Media, MediaState
from lisp.backends.gst import elements
Expand All @@ -29,10 +29,6 @@
from lisp.core.has_properties import Property


def cpu_count():
return _cpu_count() if _cpu_count() is not None else 1


def validate_pipeline(pipe):
# The first must be an input element
if pipe[0] not in elements.inputs().keys():
Expand Down Expand Up @@ -316,7 +312,7 @@ def __on_eos(self):
self.eos.emit(self)
self.interrupt(emit=False)

@async_in_pool(pool=ThreadPoolExecutor(cpu_count()))
@async_in_pool(pool=ThreadPoolExecutor(1))
def __duration(self):
self.duration = gst_uri_duration(self.input_uri())

Expand Down

0 comments on commit cb45a8c

Please sign in to comment.