audio: Never run about-to-finish from audio actor
This commit is contained in:
parent
efeac2dba8
commit
a9a2cdcb9d
@ -2,6 +2,7 @@ from __future__ import absolute_import, unicode_literals
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import threading
|
||||||
|
|
||||||
import gobject
|
import gobject
|
||||||
|
|
||||||
@ -406,6 +407,7 @@ class Audio(pykka.ThreadingActor):
|
|||||||
self.mixer = SoftwareMixer(mixer)
|
self.mixer = SoftwareMixer(mixer)
|
||||||
|
|
||||||
def on_start(self):
|
def on_start(self):
|
||||||
|
self._thread = threading.current_thread()
|
||||||
try:
|
try:
|
||||||
self._setup_preferences()
|
self._setup_preferences()
|
||||||
self._setup_playbin()
|
self._setup_playbin()
|
||||||
@ -499,6 +501,11 @@ class Audio(pykka.ThreadingActor):
|
|||||||
self.mixer.teardown()
|
self.mixer.teardown()
|
||||||
|
|
||||||
def _on_about_to_finish(self, element):
|
def _on_about_to_finish(self, element):
|
||||||
|
if self._thread == threading.current_thread():
|
||||||
|
logger.error(
|
||||||
|
'about-to-finish in actor, aborting to avoid deadlock.')
|
||||||
|
return
|
||||||
|
|
||||||
gst_logger.debug('Got about-to-finish event.')
|
gst_logger.debug('Got about-to-finish event.')
|
||||||
if self._about_to_finish_callback:
|
if self._about_to_finish_callback:
|
||||||
logger.debug('Running about to finish callback.')
|
logger.debug('Running about to finish callback.')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user