Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: generate exception if codec/layer versions or channel headers are unrecognized #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

joshtrichards
Copy link

Thanks (once again) for the useful library we use over at the Nextcloud project!

While looking into nextcloud/server#44573, I noted we might as well throw an informative exception if the codecVersion, layerVersion, or channel headers are unrecognized.

We're going to error out anyway when we try to use empty values for the array key. Instead of generating generic PHP errors when we go to set the bitRate and sampleRate or vbr_offset we can leave the user a bit less confused about the underlying cause.

I don't even know what MP3s might cause this, but seems reasonable to handle this situation cleanly if possible. :)

@jeremitu
Copy link

This is not sufficient, we need to consider CODEC_UNDEFINED, which is not covered by the tables:

        if ($this->codecVersion == self::CODEC_UNDEFINED) {
            throw new \Exception('Codec undefined');
        }

@kesselb
Copy link
Contributor

kesselb commented Jun 13, 2024

@joshtrichards mind to update your pr with jeremitu's suggestion?

I will patch the copy in nextcloud/3rdparty then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants