Skip to content

self.codec is not set appropriately on Mac #468

Open
@xsdg

Description

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:

elif self.backend == "node":

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions