1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-05-18 11:09:32 +00:00

Split a couple of lines to make the code more readable

This commit is contained in:
Ricardo Garcia 2011-03-15 20:04:20 +01:00
parent e3f7e05c27
commit 2727dbf78d

View file

@ -2620,8 +2620,8 @@ class FFmpegExtractAudioPP(PostProcessor):
@staticmethod @staticmethod
def get_audio_codec(path): def get_audio_codec(path):
try: try:
handle = subprocess.Popen(['ffprobe', '-show_streams', '--', path], cmd = ['ffprobe', '-show_streams', '--', path]
stderr=file(os.path.devnull, 'w'), stdout=subprocess.PIPE) handle = subprocess.Popen(cmd, stderr=file(os.path.devnull, 'w'), stdout=subprocess.PIPE)
output = handle.communicate()[0] output = handle.communicate()[0]
if handle.wait() != 0: if handle.wait() != 0:
return None return None
@ -2638,8 +2638,8 @@ class FFmpegExtractAudioPP(PostProcessor):
@staticmethod @staticmethod
def run_ffmpeg(path, out_path, codec, more_opts): def run_ffmpeg(path, out_path, codec, more_opts):
try: try:
ret = subprocess.call(['ffmpeg', '-y', '-i', path, '-vn', '-acodec', codec] + more_opts + ['--', out_path], cmd = ['ffmpeg', '-y', '-i', path, '-vn', '-acodec', codec] + more_opts + ['--', out_path]
stdout=file(os.path.devnull, 'w'), stderr=subprocess.STDOUT) ret = subprocess.call(cmd, stdout=file(os.path.devnull, 'w'), stderr=subprocess.STDOUT)
return (ret == 0) return (ret == 0)
except (IOError, OSError): except (IOError, OSError):
return False return False