remove ProactorEventLoop and disable ffmpeg on windows temporarily

This commit is contained in:
Jack Robison 2020-03-06 13:45:34 -05:00
parent c4905d02b9
commit ab28387692
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
2 changed files with 4 additions and 5 deletions

View file

@ -3,7 +3,6 @@ import sys
import shutil import shutil
import signal import signal
import pathlib import pathlib
import platform
import json import json
import asyncio import asyncio
import argparse import argparse
@ -262,9 +261,6 @@ def setup_logging(logger: logging.Logger, args: argparse.Namespace, conf: Config
def run_daemon(args: argparse.Namespace, conf: Config): def run_daemon(args: argparse.Namespace, conf: Config):
if sys.version_info < (3, 8) and platform.system() == "Windows":
# TODO: remove after we move to requiring Python 3.8
asyncio.set_event_loop(asyncio.ProactorEventLoop())
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
if args.verbose is not None: if args.verbose is not None:
loop.set_debug(True) loop.set_debug(True)

View file

@ -6,10 +6,11 @@ import pathlib
import re import re
import shlex import shlex
import shutil import shutil
import platform
from lbry.conf import TranscodeConfig from lbry.conf import TranscodeConfig
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
DISABLED = platform.system() == "Windows"
class VideoFileAnalyzer: class VideoFileAnalyzer:
@ -22,6 +23,8 @@ class VideoFileAnalyzer:
self._checked_ffmpeg = False self._checked_ffmpeg = False
async def _execute(self, command, arguments): async def _execute(self, command, arguments):
if DISABLED:
return "Disabled on Windows", -1
args = shlex.split(arguments) args = shlex.split(arguments)
process = await asyncio.create_subprocess_exec( process = await asyncio.create_subprocess_exec(
os.path.join(self._conf.ffmpeg_folder, command), *args, os.path.join(self._conf.ffmpeg_folder, command), *args,