Skip to content

Commit

Permalink
Renamed ffmpeg.py to audio.py to be more consistent with the new
Browse files Browse the repository at this point in the history
video.py module.
  • Loading branch information
muammar committed Aug 25, 2016
1 parent e8d7fdd commit 86ecdee
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Improvements for cases where there are virtual network interfaces
present.
- Dropped `-re` flag from ffmpeg and avconv commands.
- Renamed `ffmpeg.py` to `audio.py`.

* mkchromecast (0.3.4) **released**: 2016/08/19

Expand Down
10 changes: 5 additions & 5 deletions mkchromecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@
'parec'
]
if args.encoder_backend in backends:
import mkchromecast.ffmpeg
mkchromecast.ffmpeg.main()
else: # When casting youtube url, we do it throught the ffmpeg module
import mkchromecast.ffmpeg
mkchromecast.ffmpeg.main()
import mkchromecast.audio
mkchromecast.audio.main()
else: # When casting youtube url, we do it throught the audio module
import mkchromecast.audio
mkchromecast.audio.main()

cc.initialize_cast()

Expand Down
10 changes: 5 additions & 5 deletions mkchromecast/ffmpeg.py → mkchromecast/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
tray = mkchromecast.__init__.tray
chunk_size = mkchromecast.__init__.chunk_size
if debug == True:
print(':::ffmpeg::: chunk_size: ', chunk_size)
print(':::audio::: chunk_size: ', chunk_size)
debug = mkchromecast.__init__.debug
config = ConfigParser.RawConfigParser()
configurations = config_manager() # Class from mkchromecast.config
Expand Down Expand Up @@ -83,7 +83,7 @@
bitrate = ConfigSectionMap('settings')['bitrate']
samplerate= ConfigSectionMap('settings')['samplerate']
if debug == True:
print(':::ffmpeg::: tray ='+str(tray))
print(':::audio::: tray ='+str(tray))
print(colors.warning('Configuration file exist'))
print(colors.warning('Using defaults set there'))
print(backend,codec,bitrate,samplerate)
Expand Down Expand Up @@ -117,8 +117,8 @@
backends_dict[verifyif] = backend
backend = verifyif
if debug == True:
print(':::ffmpeg::: Program '+str(backend)+' found in '+str(verifyif))
print(':::ffmpeg::: backend dictionary '+str(backends_dict))
print(':::audio::: Program '+str(backend)+' found in '+str(verifyif))
print(':::audio::: backend dictionary '+str(backends_dict))

if codec == 'mp3':
appendmtype = 'mpeg'
Expand Down Expand Up @@ -491,7 +491,7 @@ def debug_command(): # This function add some more flags to the f
app = Flask(__name__)

if debug == True:
print(':::ffmpeg::: command '+str(command))
print(':::audio::: command '+str(command))

@app.route('/')
def index():
Expand Down
4 changes: 2 additions & 2 deletions mkchromecast/cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ def play_cast(self):
self.backend = ConfigSectionMap('settings')['backend']

if self.backend == 'ffmpeg' or self.backend == 'avconv' or self.backend == 'parec':
import mkchromecast.ffmpeg
mtype = mkchromecast.ffmpeg.mtype
import mkchromecast.audio
mtype = mkchromecast.audio.mtype
print(' ')
print(colors.options('The media type string used is:')+' '+mtype)
ncast.play_media('http://'+localip+':5000/stream', mtype)
Expand Down
8 changes: 4 additions & 4 deletions mkchromecast/tray_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from mkchromecast.audiodevices import *
from mkchromecast.cast import *
from mkchromecast.config import *
import mkchromecast.ffmpeg
import mkchromecast.audio
from mkchromecast.node import *
from mkchromecast.preferences import ConfigSectionMap
from mkchromecast.pulseaudio import *
Expand Down Expand Up @@ -76,11 +76,11 @@ def _play_cast_(self):
stream()
else:
try:
reload(mkchromecast.ffmpeg)
reload(mkchromecast.audio)
except NameError:
from imp import reload
reload(mkchromecast.ffmpeg)
mkchromecast.ffmpeg.main()
reload(mkchromecast.audio)
mkchromecast.audio.main()
if platform == 'Linux':
create_sink()
start = casting()
Expand Down

0 comments on commit 86ecdee

Please sign in to comment.