Skip to content

Conversation

low-batt
Copy link
Contributor

This commit will add code to MPVController.mpvInit that changes the value of the mpv option hwdec-codecs, removing VP9, if IINA is not running on a Mac with an Apple Silicon chip. This change works around the FFmpeg defect reported in ticket 9599.


Description:

This commit will add code to MPVController.mpvInit that changes the
value of the mpv option hwdec-codecs, removing VP9, if IINA is not
running on a Mac with an Apple Silicon chip. This change works around
the FFmpeg defect reported in ticket 9599.
@low-batt low-batt requested review from uiryuu and lhc70000 July 13, 2023 03:46
@low-batt low-batt linked an issue Jul 13, 2023 that may be closed by this pull request
1 task
@low-batt
Copy link
Contributor Author

I was at the eye doctor today, so eyes dilated and things are blurry. A critical review is needed. Especially the detection of Apple Silicon. Is there a better way to do that? So far we have not seen the problem under Apple Silicon. so the workaround is not applied when running on AS and VP9 hardware decoding is still used. Does this make sense, or should we always disable VP9 for now to be safe?

@svobs
Copy link
Contributor

svobs commented Jul 13, 2023

Especially the detection of Apple Silicon. Is there a better way to do that?

Not really. Seems like there should be, but did some searching and yours appears to be the standard solution. Very typical to see Linux shell scripts rely on parsing the uname command, so this isn't unexpected.

Have not tried running it yet, but looks like a good solution. +1 for adding a secret pref allowing the workaround to be disabled.

Also, you should know the word "workaround" (with no space) is only used as a noun. It doesn't have an exact equivalent verb in common English, although you could use "work around".

Copy link
Member

@uiryuu uiryuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other changes LGTM

Logger.log("Failed to construct string for sysinfo.machine", level: .error)
return false
}
return machine.replacingOccurrences(of: "\0", with: "") == "arm64"
Copy link
Member

@uiryuu uiryuu Jul 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest use machine.starts(with: "arm64"), which is not only more robust but also more elegant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Uploaded a new commit with this change.

This commit will add code to MPVController.mpvInit that changes the
value of the mpv option hwdec-codecs, removing VP9, if IINA is not
running on a Mac with an Apple Silicon chip. This change works around
the FFmpeg defect reported in ticket 9599.
@low-batt low-batt changed the title Workaround freeze due to VP9 hardware decode, #4486 Work around freeze due to VP9 hardware decode, #4486 Jul 14, 2023
@low-batt
Copy link
Contributor Author

On this:

+1 for adding a secret pref allowing the workaround to be disabled.

I thought about that, but instead I made sure that if this mpv option is set in Advanced settings, the workaround will not override the value configured there. In fact the workaround detects that a value has been configured for the option and does not apply the workaround. I did that so that it was clear the workaround is not being used when you read the log file.

I was wondering if we should have an internal preference that by passes the check for Apple Silicon and always applies the workaround. Just in case we find it also has trouble on Apple Silicon machines. I did not do that as so far I have not been able trigger a problem on my M1 machine.

@uiryuu uiryuu merged commit 7823a1b into develop Jul 15, 2023
@uiryuu uiryuu deleted the vp9-workaround branch July 15, 2023 13:21
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.

Freeze on Intel based Macs while playing VP9 encoded videos
3 participants