mkchromecast icon indicating copy to clipboard operation
mkchromecast copied to clipboard

`self.codec` is not set appropriately on Mac

Open xsdg opened this issue 8 months ago • 7 comments

Found by @muammar in #466

muammar@pupa ~/git/mkchromecast [master]
± % bin/mkchromecast --debug --discover                                                                                                                                                                         !3222
Traceback (most recent call last):
  File "/Users/muammar/git/mkchromecast/bin/mkchromecast", line 285, in <module>
    mkcc = mkchromecast.Mkchromecast()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muammar/git/mkchromecast/bin/../mkchromecast/__init__.py", line 194, in __init__
    elif self.codec in constants.CODECS_WITH_BITRATE:
         ^^^^^^^^^^
AttributeError: 'Mkchromecast' object has no attribute 'codec'. Did you mean: 'vcodec'?

The issue is here:
https://github.com/muammar/mkchromecast/blob/1d14cdfdc87bab288c889b073ac2e222e9a8309d/mkchromecast/init.py#L144

On Mac, the default backend is "node" and the default codec is "mp3", which is the only codec supported by the node backend. When args.codec is set to anything else, we override and set self.codec to "mp3", which is correct. But when args.codec is correct, we never copy it into self.codec, and self.codec remains unset.

xsdg avatar May 27 '24 21:05 xsdg