Browse Source

Remove debugging, don't open a pipe for stderr

feature/voice
Andrei 8 years ago
parent
commit
e044b9b7ec
  1. 7
      disco/voice/opus.py
  2. 2
      disco/voice/player.py

7
disco/voice/opus.py

@ -258,7 +258,7 @@ class DCADOpusEncoder(OpusEncoder):
'--packet-loss-percent', '30',
'--input', 'pipe:0',
'--output', 'pipe:1',
], stdin=self.source.stdout, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
], stdin=self.source.stdout, stdout=subprocess.PIPE)
return self._proc
def have_frame(self):
@ -267,14 +267,9 @@ class DCADOpusEncoder(OpusEncoder):
def next_frame(self):
header = self.proc.stdout.read(self.header_size)
if len(header) < self.header_size:
print 'read less than required header size'
print self.proc.poll()
self._proc = None
return
if self.proc.poll() is not None:
print 'read that data when she dead n gone: %s' % self.proc.poll()
size = struct.unpack('<h', header)[0]
data = self.proc.stdout.read(size)

2
disco/voice/player.py

@ -63,7 +63,7 @@ class FFmpegPlayable(object):
'-loglevel', 'warning',
'pipe:1'
]
self._proc = subprocess.Popen(args, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
self._proc = subprocess.Popen(args, stdin=None, stdout=subprocess.PIPE)
return self._proc
def have_frame(self):

Loading…
Cancel
Save