Skip to content

Commit

Permalink
Some code commented.
Browse files Browse the repository at this point in the history
  • Loading branch information
muammar committed May 2, 2016
1 parent 9f93049 commit b251663
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions mkchromecast/ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import os, sys, time
from functools import partial
from subprocess import Popen, PIPE
from flask import Flask, Response
from flask import Flask, Response, request
import multiprocessing, threading
import psutil, pickle
from os import getpid
Expand Down Expand Up @@ -161,7 +161,6 @@ def debug_command():
else:
command = [backend, '-re', '-f', 'avfoundation', '-audio_device_index', '0', '-i', '', \
'-acodec', 'flac', '-f', 'flac','-ac', '2', '-ar', samplerate, 'pipe:']
#'-acodec', 'flac', '-f', 'flac','-ac', '2', '-ar', samplerate, '-q:a', '330', '-cutoff', '15000', 'pipe:']
if debug == False:
debug_command()

Expand All @@ -177,6 +176,23 @@ def index():
</audio>""".format(mp3file=mp3file)


"""
The code below is supposed to kill the Flask server. I don't know if it would
be useful later.
"""
"""
def shutdown_server():
func = request.environ.get('werkzeug.server.shutdown')
if func is None:
raise RuntimeError('Not running with the Werkzeug Server')
func()
@app.route('/shutdown', methods=['POST'])
def shutdown():
shutdown_server()
return 'Server shutting down...'
"""
@app.route('/' + mp3file)
def stream():
process = Popen(command, stdout=PIPE, bufsize=-1)
Expand Down

0 comments on commit b251663

Please sign in to comment.