diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2013-07-09 14:18:50 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2013-07-09 14:18:50 +0200 |
commit | bc01b176e18583cae3b018fded4acc89c15ca620 (patch) | |
tree | 3226ae49456f864e786f961206dbc01207cdab75 | |
parent | libav no longer ships ffmpeg, so use avconv (diff) | |
download | zmusic-ng-bc01b176e18583cae3b018fded4acc89c15ca620.tar.xz zmusic-ng-bc01b176e18583cae3b018fded4acc89c15ca620.zip |
transcoding: do not buffer avconv output
Switching to avconv from ffmpeg in 8544def introduced additional
buffering to output streams, which caused uwsgi to timeout when reading
from the internal socket when particularly fast clients were connected.
The fix is to pass 'nobuffer' to the format flags.
-rw-r--r-- | backend/zmusic/endpoints/song.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/backend/zmusic/endpoints/song.py b/backend/zmusic/endpoints/song.py index 01c8002..3f6e5ff 100644 --- a/backend/zmusic/endpoints/song.py +++ b/backend/zmusic/endpoints/song.py @@ -36,7 +36,7 @@ def song(id, ext): if ext not in [ "ogg", "mp3", "flac", "wav", "webm" ]: return abort(404) - transcode_options = [ 'avconv', '-loglevel', 'quiet', '-i', song.filename, '-f', ext, '-y' ]; + transcode_options = [ 'avconv', '-loglevel', 'quiet', '-i', song.filename, '-f', ext, '-y', '-fflags', 'nobuffer' ]; if ext == "ogg" or ext == "webm": transcode_options.extend([ '-acodec', 'libvorbis', '-aq', '5' ]) elif ext == "mp3": |